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))
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))
def test_fetch_whole_file(self): main(['data/genes.fasta'])
def test_short_line_lengths(self): main(['data/genes.fasta', '--bed', 'data/malformed.bed'])
def test_not_regexp_multi(self): main(['data/genes.fasta', '-g', 'XR', '-g', 'XM', '-v'])
def test_regexp(self): main(['data/genes.fasta', '-g', 'XR'])
def test_key_warning(self): main(['data/genes.fasta', 'foo'])
def test_fetch_error(self): main(['data/genes.fasta', 'gi|557361099|gb|KF435150.1|:1-1000'])
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')
from pyfaidx.cli import main if __name__ == '__main__': main()