Пример #1
0
 def add_vcf_file_to_annotator(self, vcf_file_path, force_all=False):
     """
     Add the variants in vcf_file_path to annotator
     Convenience wrapper around add_variants_to_annotator
     """
     if not force_all and self.get_annotator_datastore().vcf_files.find_one(
         {'vcf_file_path': vcf_file_path}):
         print "VCF already annotated"
         return
     print "Scanning VCF file first..."
     variant_t_list = []
     for variant_t in vcf_stuff.iterate_tuples(
             compressed_file(vcf_file_path)):
         variant_t_list.append(variant_t)
         if len(variant_t_list) == 100000:
             print "Adding another 100000 variants, through {}".format(
                 variant_t_list[-1][0])
             self.add_variants_to_annotator(variant_t_list, force_all)
             variant_t_list = []
     self.add_variants_to_annotator(variant_t_list, force_all)
     self.get_annotator_datastore().vcf_files.insert({
         'vcf_file_path':
         vcf_file_path,
         'date_added':
         datetime.datetime.utcnow()
     })
Пример #2
0
 def add_vcf_file_to_annotator(self, vcf_file_path, force_all=False):
     """
     Add the variants in vcf_file_path to annotator
     Convenience wrapper around add_variants_to_annotator
     """
     print "Scanning VCF file first..."
     variant_t_list = []
     for variant_t in vcf_stuff.iterate_tuples(compressed_file(vcf_file_path)):
         variant_t_list.append(variant_t)
         if len(variant_t_list) == 100000:
             print "Adding another 100000 variants, through {}".format(variant_t_list[-1][0])
             self.add_variants_to_annotator(variant_t_list, force_all)
             variant_t_list = []
     self.add_variants_to_annotator(variant_t_list, force_all)
Пример #3
0
 def add_vcf_file_to_annotator(self, vcf_file_path, force_all=False):
     """
     Add the variants in vcf_file_path to annotator
     Convenience wrapper around add_variants_to_annotator
     """
     if not force_all and self._db.vcf_files.find_one({'vcf_file_path': vcf_file_path}):
         print "VCF already annotated"
         return
     print "Scanning VCF file first..."
     variant_t_list = []
     for variant_t in vcf_stuff.iterate_tuples(compressed_file(vcf_file_path)):
         variant_t_list.append(variant_t)
         if len(variant_t_list) == 100000:
             print "Adding another 100000 variants, through {}".format(variant_t_list[-1][0])
             self.add_variants_to_annotator(variant_t_list, force_all)
             variant_t_list = []
     self.add_variants_to_annotator(variant_t_list, force_all)
     self._db.vcf_files.insert({'vcf_file_path': vcf_file_path, 'date_added': datetime.datetime.utcnow()})