Ejemplo n.º 1
0
    def test_indexstar_and_mapstar(self):
        genome = make_fasta_file(num_sequences=2, seq_len=1000, rnd_seed=0)
        fastq = make_fastq_file(genome=genome, rnd_seed=0)

        command_basic = [
            'iCount',
            'indexstar',
            genome,
            self.dir,
            '-S',
            '40',  # Supress lower than ERROR messages.
        ]
        self.assertEqual(subprocess.call(command_basic), 0)

        command_basic = [
            'iCount',
            'mapstar',
            fastq,
            self.dir,
            self.dir2,
            '-S',
            '40',  # Supress lower than ERROR messages.
        ]

        self.assertEqual(subprocess.call(command_basic), 0)
Ejemplo n.º 2
0
    def test_cutadapt(self):
        adapter = 'CCCCCCCCC'
        fastq = make_fastq_file(adapter=adapter,
                                out_file=get_temp_file_name(extension='fastq'),
                                rnd_seed=0)

        command_basic = [
            'iCount',
            'cutadapt',
            fastq,
            self.tmp1,
            adapter,
            '-S',
            '40',  # Supress lower than ERROR messages.
        ]
        command_full = [
            'iCount',
            'cutadapt',
            fastq,
            self.tmp1,
            adapter,
            '--qual_trim',
            '20',
            '--minimum_length',
            '15',
            '-S',
            '40',  # Supress lower than ERROR messages.
        ]

        self.assertEqual(subprocess.call(command_basic), 0)
        self.assertEqual(subprocess.call(command_full), 0)
Ejemplo n.º 3
0
 def setUp(self):
     self.adapter = 'AAAATTTTCCCCGGGG'
     self.reads = make_fastq_file(
         adapter=self.adapter,
         num_sequences=100,
         out_file=get_temp_file_name(extension='fastq'))
     self.tmp = get_temp_file_name(extension='fastq')
     warnings.simplefilter("ignore", ResourceWarning)
Ejemplo n.º 4
0
 def setUp(self):
     self.dir = get_temp_dir()
     self.adapter = 'CCCCCCCCC'
     self.barcodes = [
         'NNNGGTTNN',
         'NNNTTGTNN',
         'NNNCAATNN',
         'NNNACCTNN',
         'NNNGGCGNN',
     ]
     self.reads = make_fastq_file(barcodes=self.barcodes,
                                  adapter=self.adapter)
     warnings.simplefilter("ignore", ResourceWarning)
Ejemplo n.º 5
0
    def test_demultiplex(self):
        barcodes = [
            'NNNTTGTNN',
            'NNNGGTTNN',
            'NNNGGCGNN',
        ]
        bar1, bar2, bar3 = barcodes
        adapter = 'CCCCCCCCC'
        fastq = make_fastq_file(barcodes=barcodes, adapter=adapter, rnd_seed=0)

        command_basic = [
            'iCount',
            'demultiplex',
            fastq,
            adapter,
            bar1,
            bar2,
            bar3,
            '--mismatches',
            '2',
            '--out_dir',
            self.dir,  # put files in tmpdir, to not pollute cwd.
            '-S',
            '40',  # Supress lower than ERROR messages.
        ]
        command_full = [
            'iCount',
            'demultiplex',
            fastq,
            adapter,
            bar1,
            bar2,
            bar3,
            '--mismatches',
            '2',
            '--minimum_length',
            '15',
            '--prefix',
            'demux',
            '--out_dir',
            self.dir,
            '-S',
            '40',  # Supress lower than ERROR messages.
        ]

        self.assertEqual(subprocess.call(command_basic), 0)
        self.assertEqual(subprocess.call(command_full), 0)
Ejemplo n.º 6
0
 def setUp(self):
     self.dir = get_temp_dir()
     self.index_dir = get_temp_dir()
     self.genome = make_fasta_file(num_sequences=2, seq_len=1000)
     self.reads = make_fastq_file(genome=self.genome)
     self.annotation = make_file_from_list([
         ['1', '.', 'gene', '10', '20', '.', '+', '.', 'gene_id "A";'],
         [
             '1', '.', 'transcript', '10', '20', '.', '+', '.',
             'gene_id "A"; transcript_id "AA";'
         ],
         [
             '1', '.', 'exon', '10', '20', '.', '+', '.',
             'gene_id "A"; transcript_id "AA"; exon_number "1";'
         ],
     ])
     warnings.simplefilter("ignore", ResourceWarning)
Ejemplo n.º 7
0
    def test_indexstar_and_mapstar_full(self):
        genome = make_fasta_file(num_sequences=2, seq_len=1000, rnd_seed=0)
        fastq = make_fastq_file(genome=genome, rnd_seed=0)

        command_full = [
            'iCount',
            'indexstar',
            genome,
            self.dir,
            '--annotation',
            self.gtf,
            '--overhang',
            '100',
            '--overhang_min',
            '8',
            '--threads',
            '1',
            '-S',
            '40',  # Supress lower than ERROR messages.
        ]
        self.assertEqual(subprocess.call(command_full), 0)

        command_full = [
            'iCount',
            'mapstar',
            fastq,
            self.dir,
            self.dir2,
            '--annotation',
            self.gtf,
            '--multimax',
            '50',
            '--mismatches',
            '2',
            '--threads',
            '1',
            '-S',
            '40',  # Supress lower than ERROR messages.
        ]
        self.assertEqual(subprocess.call(command_full), 0)