Exemplo n.º 1
0
def main():
    "Everything starts here"
    if len(sys.argv) >= 2:
        if sys.argv[1] == "variants-list":
            vl1 = VariantsLister(sys.argv[2:])
            return vl1.main()
        elif sys.argv[1] == "evidence-items-list":
            eil1 = EvidenceItemsLister(sys.argv[2:])
            return eil1.main()
        elif sys.argv[1] == "action-items-web-view":
            web_view()
        elif sys.argv[1] == "tsv-create":
            tsv1 = TsvFileLister(sys.argv[2:])
            return tsv1.main()
        else:
            return usage()
 def create_invalid_eis_list(self):
     "Create the list of invalid evidence items"
     vl1 = VariantsLister(self.args)
     vl1.get_civic_genes()
     variant_ids = vl1.get_variant_ids()
     for variant_id in variant_ids:
         variant_detail = vl1.get_variant_details(variant_id)
         if "evidence_items" in variant_detail:
             evidence_items = variant_detail['evidence_items']   
             if self.args.doid:
                 #If not valid, add to list of invalids
                 self.check_doid(variant_id, variant_detail, evidence_items)
             if self.args.drug:
                 #If drug doesn't exist, add to list of invalids
                 self.check_drug_for_pre(variant_id, variant_detail,evidence_items)
             # if neither of the flags were specified, do both checks
             if not (self.args.doid or self.args.drug):
                 self.check_doid(variant_id, variant_detail, evidence_items)
                 self.check_drug_for_pre(variant_id, variant_detail,evidence_items)
Exemplo n.º 3
0
    def get_info_and_print(self):
        "Get variants and evidence items "
        vl1 = VariantsLister(self.args)
        vl1.get_civic_genes()
        variant_ids = vl1.get_variant_ids()

        file_name = 'ClinicalEvidenceSummary_'+time.strftime('%d%m%Y')+'.tsv'
        output = open(file_name,'w')
        header = self.make_header()
        output.write(header)

        for variant_id in variant_ids:
            variant_detail = vl1.get_variant_details(variant_id)
            if "evidence_items" in variant_detail:
                evidence_items = variant_detail['evidence_items'] 
                for evidence_item in evidence_items:
                    tsv_item = TsvEvidenceItmes(variant_detail, evidence_item)
                    output.write(tsv_item.make_str_for_print())
        output.close()
Exemplo n.º 4
0
def main():
    "Everything starts here"
    try:
        if len(sys.argv) >= 2:
            if sys.argv[1] == "variants-list":
                vl1 = VariantsLister(sys.argv[2:])
                return vl1.main()
            elif sys.argv[1] == "evidence-items-list":
                eil1 = EvidenceItemsLister(sys.argv[2:])
                return eil1.main()
            elif sys.argv[1] == "action-items-web-view":
                web_view()
            elif sys.argv[1] == "tsv-create":
                tsv1 = TsvFileLister(sys.argv[2:])
                return tsv1.main()
            else:
                return usage()
    except KeyboardInterrupt:
        print ("Interrupted!")
        sys.exit(0)
Exemplo n.º 5
0
 def variants():
     vl1 = VariantsLister(sys.argv[2:])
     vl1.parse_args()
     vl1.create_filtered_variants_list()
     filtered_variant_details = vl1.get_filtered_variant_details()
     return render_template('variants.html', \
             filtered_variant_details= filtered_variant_details)