Пример #1
0
    def test_stap_aureus_pacbio(self):
        logger = logging.getLogger(__name__)
        kmer = 11

        pr = cProfile.Profile()
        pr.enable()

        fastas = Fastas(logger, databases + '/Staphylococcus_aureus/', kmer,
                        False)
        mlst_profile = MlstProfile(databases +
                                   '/Staphylococcus_aureus/profile.txt')

        fastq = Fastq(logger,
                      os.path.join(data_dir, 'NCTC11150.fastq.gz'),
                      kmer,
                      fastas.get_fastas_to_kmers(),
                      10,
                      mlst_profile,
                      50,
                      None,
                      None,
                      max_kmers=1)
        self.assertTrue(fastq.read_filter_and_map())

        pr.disable()
        s = io.StringIO()
        sortby = 'cumulative'
        ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
        ps.print_stats()
        print(s.getvalue())
Пример #2
0
    def test_salmonella_welt_pacbio(self):
        logger = logging.getLogger(__name__)
        kmer = 11
        fastas = Fastas(logger, data_dir, kmer, False)
        mlst_profile = MlstProfile(data_dir + '/profile.txt')

        fastq = Fastq(logger, os.path.join(data_dir, 'pacbio.fastq.gz'), kmer,
                      fastas.get_fastas_to_kmers(), 10, mlst_profile, 50, None,
                      None)
        self.assertTrue(fastq.read_filter_and_map())
Пример #3
0
    def test_four_kmers(self):
        logger = logging.getLogger(__name__)
        fastas = Fastas(logger, data_dir, 4, False)
        mlst_profile = MlstProfile(data_dir + '/profile.txt')

        fastq = Fastq(logger, os.path.join(data_dir, 'query.fastq'), 4,
                      fastas.get_fastas_to_kmers(), 1, mlst_profile, 50, None,
                      None)

        self.assertTrue(fastq.read_filter_and_map())
Пример #4
0
    def test_kp_nanopore(self):
        logger = logging.getLogger(__name__)
        kmer = 11
        fastas = Fastas(logger, databases + '/Klebsiella_pneumoniae/', kmer,
                        False)
        mlst_profile = MlstProfile(databases +
                                   '/Klebsiella_pneumoniae/profile.txt')

        fastq = Fastq(logger, os.path.join(data_dir,
                                           'nanopore_kp_12.fastq.gz'), kmer,
                      fastas.get_fastas_to_kmers(), 10, mlst_profile, 50, None,
                      None)
        self.assertTrue(fastq.read_filter_and_map())
Пример #5
0
 def run(self):
     mlst_profile = MlstProfile(self.mlst_profile_file())
     fastas = Fastas(self.logger, self.allele_directory, self.kmer,
                     self.divisible_by_3)
     fastq = Fastq(self.logger,
                   self.input_fastq,
                   self.kmer,
                   fastas.get_fastas_to_kmers(),
                   self.min_fasta_hits,
                   mlst_profile,
                   self.print_interval,
                   self.output_file,
                   self.filtered_reads_file,
                   target_st=self.target_st,
                   max_gap=self.max_gap,
                   min_block_size=self.min_block_size,
                   margin=self.margin,
                   start_time=self.start_time,
                   min_kmers_for_onex_pass=self.min_kmers_for_onex_pass)
     fastq.read_filter_and_map()