Ejemplo n.º 1
0
    def setup(self):
        DB.drop_database('mykrobe-test')

        self.reference_set = ReferenceSet().create_and_save(name="ref_set")
        self.variant_set = VariantSet.create_and_save(
            name="this_vcf_file2", reference_set=self.reference_set)
        self.variant_sets = [self.variant_set]
        self.reference = Reference().create_and_save(
            name="ref", md5checksum="sre", reference_sets=[self.reference_set])
        self.call_set = VariantCallSet.create(sample_id="C00123",
                                              name="C00123",
                                              variant_sets=self.variant_sets)
        self.variant_snp = Variant.create(variant_sets=self.variant_sets,
                                          start=0,
                                          end=1,
                                          reference_bases="A",
                                          alternate_bases=["T"],
                                          reference=self.reference)

        self.variant_snp_mult_alts = Variant.create(
            variant_sets=self.variant_sets,
            start=0,
            end=1,
            reference_bases="T",
            alternate_bases=["A", "C"],
            reference=self.reference)
Ejemplo n.º 2
0
    def setup(self):
        DB.drop_database('mykrobe-test')

        self.reference_set = ReferenceSet().create_and_save(name="ref_set")
        self.variant_set = VariantSet.create_and_save(
            name="this_vcf_file", reference_set=self.reference_set)
        self.variant_sets = [self.variant_set]
Ejemplo n.º 3
0
 def global_variant_set(self):
     try:
         vs = VariantSet.objects.get(name=GLOBAL_VARIANT_SET_NAME)
     except:
         vs = VariantSet.create_and_save(name=GLOBAL_VARIANT_SET_NAME,
                                         reference_set=self.reference_set)
     return vs
Ejemplo n.º 4
0
 def setup(self):
     DB.drop_database('mykrobe-test')
     self.pg = AlleleGenerator(
         reference_filepath="src/mykrobe/data/BX571856.1.fasta")
     self.reference_set = ReferenceSet().create_and_save(name="ref_set")
     self.variant_set = VariantSet.create_and_save(
         name="this_vcf_file", reference_set=self.reference_set)
     self.variant_sets = [self.variant_set]
     self.reference = Reference().create_and_save(
         name="ref", md5checksum="sre", reference_sets=[self.reference_set])
Ejemplo n.º 5
0
 def setup(self):
     DB.drop_database("mykrobe-test")
     self.pg = AlleleGenerator(
         reference_filepath=f"{DATA_DIR}/NC_000962.3.fasta", kmer=31)
     self.reference_set = ReferenceSet().create_and_save(name="ref_set")
     self.variant_set = VariantSet.create_and_save(
         name="this_vcf_file", reference_set=self.reference_set)
     self.variant_sets = [self.variant_set]
     self.reference = Reference().create_and_save(
         name="ref", md5checksum="sre", reference_sets=[self.reference_set])
Ejemplo n.º 6
0
 def _create_new_variant_set(self):
     variant_set_name = os.path.basename(self.f)
     if VariantSet.objects(name=variant_set_name,
                           reference_set=self.reference_set):
         if not self.force:
             raise NotUniqueError(
                 "VariantSet %s already exists. Rerun with -f to recreate."
                 % variant_set_name)
         else:
             self._remove_variant_set(variant_set_name)
     self.vcf_variant_set = VariantSet.create_and_save(
         name=variant_set_name, reference_set=self.reference_set)
Ejemplo n.º 7
0
    def setup(self):
        DB.drop_database('mykrobe-test')
        with open("src/mykrobe/data/NC_000962.3.fasta", 'r') as infile:
            self.reference_seq = list(SeqIO.parse(infile, "fasta"))[0].seq

        self.gm = GeneAminoAcidChangeToDNAVariants(
            reference="src/mykrobe/data/NC_000962.3.fasta",
            genbank="src/mykrobe/data/NC_000962.3.gb")
        self.reference_set = ReferenceSet().create_and_save(name="ref_set")
        self.variant_set = VariantSet.create_and_save(
            name="this_vcf_file", reference_set=self.reference_set)
        self.variant_sets = [self.variant_set]
        self.reference_id = Reference().create_and_save(
            name="ref", md5checksum="sre", reference_sets=[self.reference_set])
Ejemplo n.º 8
0
 def test_create_new_variant(self):
     variant_set = VariantSet.create_and_save(
         name="this_vcf_file", reference_set=self.reference_set)
     vs = VariantSet.objects.get(name="this_vcf_file")
     assert variant_set == vs
     assert vs.reference_set.name == "ref_set"