Beispiel #1
0
def test_read_multiple_sj_out_tab(sj_filenames, ignore_multimapping,
                                  splice_junction_csv):
    from outrigger.io.star import read_multiple_sj_out_tab
    from outrigger.common import READS

    # Read csv file and convert to numeric
    true = pd.read_csv(splice_junction_csv)
    true = true.convert_objects()

    test = read_multiple_sj_out_tab(
        sj_filenames, ignore_multimapping=ignore_multimapping)
    assert READS in test
    pdt.assert_frame_equal(test, true)
Beispiel #2
0
def test_read_multiple_sj_out_tab(sj_filenames, ignore_multimapping,
                                  splice_junction_csv):
    from outrigger.io.star import read_multiple_sj_out_tab
    from outrigger.common import READS

    # Read csv file and convert to numeric
    true = pd.read_csv(splice_junction_csv)
    true = true.convert_objects()

    test = read_multiple_sj_out_tab(sj_filenames,
                                    ignore_multimapping=ignore_multimapping)
    assert READS in test
    pdt.assert_frame_equal(test, true)
Beispiel #3
0
 def make_junction_reads_file(self):
     if self.bams is None:
         util.progress(
             'Reading SJ.out.files and creating a big splice junction'
             ' table of reads spanning exon-exon junctions...')
         splice_junctions = star.read_multiple_sj_out_tab(
             self.sj_out_tab,
             ignore_multimapping=self.ignore_multimapping)
     else:
         util.progress('Reading bam files and creating a big splice '
                       'junction table of reads spanning exon-exon '
                       'junctions')
         splice_junctions = bam.read_multiple_bams(
             self.bams, self.ignore_multimapping, self.n_jobs)
     dirname = os.path.dirname(self.junction_reads)
     if not os.path.exists(dirname):
         os.makedirs(dirname)
     util.progress('Writing {} ...\n'.format(self.junction_reads))
     splice_junctions.to_csv(self.junction_reads, index=False)
     util.done()
     return splice_junctions