Example #1
0
 def test_auto_strand(self):
     """ Test that --auto-strand produces the same output as --reverse --complement"""
     with NamedTemporaryFile() as auto_strand:
         with NamedTemporaryFile() as noto_strand:
             main(['--auto-strand', '-o', auto_strand.name, 'data/genes.fasta', 'gi|557361099|gb|KF435150.1|:100-1'])
             main(['--reverse', '--complement', '-o', noto_strand.name, 'data/genes.fasta', 'gi|557361099|gb|KF435150.1|:1-100'])
             print(auto_strand.read())
             print()
             print(noto_strand.read())
             self.assertTrue(filecmp.cmp(auto_strand.name, noto_strand.name))
Example #2
0
 def test_auto_strand(self):
     """ Test that --auto-strand produces the same output as --reverse --complement"""
     with NamedTemporaryFile() as auto_strand:
         with NamedTemporaryFile() as noto_strand:
             main([
                 '--auto-strand', '-o', auto_strand.name,
                 'data/genes.fasta', 'gi|557361099|gb|KF435150.1|:100-1'
             ])
             main([
                 '--reverse', '--complement', '-o', noto_strand.name,
                 'data/genes.fasta', 'gi|557361099|gb|KF435150.1|:1-100'
             ])
             print(auto_strand.read())
             print()
             print(noto_strand.read())
             self.assertTrue(filecmp.cmp(auto_strand.name,
                                         noto_strand.name))
Example #3
0
 def test_fetch_whole_file(self):
     main(['data/genes.fasta'])
Example #4
0
 def test_short_line_lengths(self):
     main(['data/genes.fasta', '--bed', 'data/malformed.bed'])
Example #5
0
 def test_not_regexp_multi(self):
     main(['data/genes.fasta', '-g', 'XR', '-g', 'XM', '-v'])
Example #6
0
 def test_regexp(self):
     main(['data/genes.fasta', '-g', 'XR'])
Example #7
0
 def test_not_regexp_multi(self):
     main(['data/genes.fasta', '-g', 'XR', '-g', 'XM', '-v'])
Example #8
0
 def test_regexp(self):
     main(['data/genes.fasta', '-g', 'XR'])
Example #9
0
 def test_key_warning(self):
     main(['data/genes.fasta', 'foo'])
Example #10
0
 def test_fetch_error(self):
     main(['data/genes.fasta', 'gi|557361099|gb|KF435150.1|:1-1000'])
Example #11
0
 def test_split_entry(self):
     main(['--split-files', 'data/genes.fasta', 'gi|557361099|gb|KF435150.1|'])
     assert os.path.exists('gi557361099gbKF435150.1.fasta')
     os.remove('gi557361099gbKF435150.1.fasta')
Example #12
0
 def test_fetch_whole_file(self):
     main(['data/genes.fasta'])
Example #13
0
 def test_short_line_lengths(self):
     main(['data/genes.fasta', '--bed', 'data/malformed.bed'])
from pyfaidx.cli import main

if __name__ == '__main__':
    main()