Exemple #1
0
    def setUp(self):
        reference_path = testdata.REFERENCE_FASTA
        dups_path = testdata.REFERENCE_DUPS
        reference = ReferenceGenome()
        reference.import_fasta_file(reference_path)
        reference.import_dups_file(dups_path)
        self.genome = GenomeCollection()
        fasta = FastaGenome()
        fasta.import_fasta_file(reference_path)
        self.genome.add_genome(fasta)
        self.genome.set_reference(reference)
        # Statistics are gathered when the matrices are created
        self.genome.write_to_matrices({})

        self.tmpfile = tempfile.NamedTemporaryFile(mode='w', delete=False)
Exemple #2
0
    def setUp(self):
        reference_path = testdata.REFERENCE_FASTA
        dups_path = testdata.REFERENCE_DUPS
        reference = ReferenceGenome()
        reference.import_fasta_file(reference_path)
        reference.import_dups_file(dups_path)
        self.genome = GenomeCollection()
        fasta = FastaGenome()
        fasta.import_fasta_file(reference_path)
        self.genome.add_genome(fasta)
        self.genome.set_reference(reference)

        self.tmpfile = tempfile.NamedTemporaryFile(mode='w', delete=False)

        self.matrix_formats = [
            {
                'dataformat': 'matrix',
                'handle': self.tmpfile,
                'filter': ''
            }
        ]
Exemple #3
0
    def setUp(self):
        reference = ReferenceGenome()
        with tempfile.NamedTemporaryFile(mode='w+') as tmpfile:
            # Position 5 and 6 can be anything, the others must match the VCF REF column or an exception will be thrown.
            tmpfile.write('>500WT1_test\nCCTGGGGA')
            tmpfile.seek(0)
            reference.import_fasta_file(tmpfile.name)
        self.genome = GenomeCollection()
        from nasp.vcf_to_matrix import read_vcf_file
        for genome in read_vcf_file(reference, 10, .9, testdata.GATK_VCF):
            self.genome.add_genome(genome)
        self.genome.set_reference(reference)

        self.tmpfile = tempfile.NamedTemporaryFile(mode='w', delete=False)

        self.matrix_formats = [
            {
                'dataformat': 'vcf',
                'handle': self.tmpfile,
                'filter': ''
            }
        ]