Mercurial > repos > vimalkumarvelayudhan > riboplot
comparison tests/test_riboplot.py @ 6:2ffa8172dce1
Tests for valid RNA Seq bam and warnings when there are no RNA counts
| author | Vimalkumar Velayudhan <vimal@biotechcoder.com> |
|---|---|
| date | Wed, 12 Aug 2015 16:28:43 +0100 |
| parents | 8e1efafa6277 |
| children | 096c6bbf4a04 |
comparison
equal
deleted
inserted
replaced
| 5:cef780bcce01 | 6:2ffa8172dce1 |
|---|---|
| 109 """Test get RNA counts for transcript from RNA-Seq BAM file. Assumes bedtools is installed.""" | 109 """Test get RNA counts for transcript from RNA-Seq BAM file. Assumes bedtools is installed.""" |
| 110 counts = riboplot.get_rna_counts(RNA_FILE, TRANSCRIPT_NAME) | 110 counts = riboplot.get_rna_counts(RNA_FILE, TRANSCRIPT_NAME) |
| 111 self.assertIsInstance(counts, dict) | 111 self.assertIsInstance(counts, dict) |
| 112 self.assertTrue(len(counts) > 0) | 112 self.assertTrue(len(counts) > 0) |
| 113 | 113 |
| 114 def test_invalid_rna_file(self): | |
| 115 """If an invalid RNA file is provided, generate an error message""" | |
| 116 # using transcriptome FASTA file as the invalid RNA file for test | |
| 117 parser = riboplot.create_parser() | |
| 118 args = parser.parse_args(['-b', RIBO_FILE, '-f', TRANSCRIPTOME_FASTA, '-t', TRANSCRIPT_NAME, '-n', TRANSCRIPTOME_FASTA]) | |
| 119 self.assertRaises(ValueError, ribocore.check_optional_arguments, args.ribo_file, args.rna_file) | |
| 114 | 120 |
| 115 class RiboPlotTestCase(unittest.TestCase): | 121 class RiboPlotTestCase(unittest.TestCase): |
| 116 | 122 |
| 117 def test_get_codon_positions(self): | 123 def test_get_codon_positions(self): |
| 118 """Get codon positions in all frames given a sequence.""" | 124 """Get codon positions in all frames given a sequence.""" |
| 156 | 162 |
| 157 @unittest.skip('todo') | 163 @unittest.skip('todo') |
| 158 def test_write_ribo_counts(self): | 164 def test_write_ribo_counts(self): |
| 159 """Write RiboSeq read counts as CSV.""" | 165 """Write RiboSeq read counts as CSV.""" |
| 160 pass | 166 pass |
| 161 | |
| 162 @unittest.skip('todo') | |
| 163 def test_plot_read_counts(self): | |
| 164 """Generate riboplots""" | |
| 165 pass |
