Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test phyta-extract

  • Loading branch information...
commit 4c5ec2a0d1b3149e464db86987ad407391576fca 1 parent 9e75497
Philipp Comans authored
View
8 bin/phyta-extract
@@ -28,7 +28,7 @@ require 'trollop'
#parse command line arguments
opts = Trollop::options do
opt :fasta, "The file containing the sequences in FASTA format", :type => String
- opt :input_clean, "The name of the clean sequence table in CSV format", :type => String
+ opt :input_clean, "The name of the clean sequence table in CSV format", :type => String, :short => "-c"
opt :input_contaminated, "The name of the contaminated sequence table in CSV format", :type => String, :short => "-d"
opt :output_clean, "The name of the FASTA file where clean sequences will be written to", :type => String, :short => "-o"
@@ -47,12 +47,6 @@ rootpath = File.dirname(File.dirname(__FILE__))
PHYTA_VERSION = File.new(File.join(rootpath,'VERSION')).read.chomp
puts "Running #{SCRIPT_NAME} #{PHYTA_VERSION}"
-opts[:fasta] = ARGV.shift
-opts[:input_clean] = ARGV.shift
-opts[:input_contaminated] = ARGV.shift
-opts[:output_clean] = ARGV.shift
-opts[:output_contaminated] = ARGV.shift
-
unless File.exists?(opts[:fasta])
abort "The input file at " + File.expand_path(opts[:fasta]) + " could not be opened!"
end
View
0  test/data/extract/clean_empty_clean.csv
No changes.
View
0  test/data/extract/clean_empty_clean_target.fasta
No changes.
View
2  test/data/extract/clean_empty_contaminated.csv
@@ -0,0 +1,2 @@
+query sequence id;hit accession number;sgi;evalue;species;subject annotation;subject score;kingdom
+AW5C4;XP_001629010;156372369;1.85315736381546e-09;Astrosclera willeyana;predicted protein;66.2401644268205;Parabasalia
View
15 test/data/extract/clean_empty_contaminated_target.fasta
@@ -0,0 +1,15 @@
+>AW5C4 [Astrosclera_willeyana]
+CGGCCGGGCAGCACAACTTCTAACGGTGGACCCCTCGGCTCGTGCATCGATGAAGAACGC
+AGCAAACTGCGATACGTAGTGTGAATTGCAGAATTCAGTGAATCATCGAGTCTTTGAACG
+CAAATGGCGCTCCCGGTCAAGCCGGGAGCACGTCTGTCTGAGCGTCCTTTTCATTGAAGT
+GCAAGCCTTGCGTTTGCAGTGATTTGAGGAGTTGTCGAGTGCCTTTCCGAGTCGCCGGCA
+TCCCTTGAAGTCGTGCACTGTCCGTCACAGACAGCCAAGTGCAGGAGAGTTGCTTGCGCT
+TGGACTTCTGTGCGAGACTTGTGTTGAGAGCCCACTTTTGTACAGTTGgacctcagatca
+ggcgaggctacctgctgaacttaagcatatcaataagcagaggaaaagaaactaacaagg
+attcccccagtaacggcgagcgaagtgggaaaagctcgagcctgaaatctctggcagttg
+atgccagcgaattgtggccgggagaggcagctggaccctggctagcgctgtcgaagttga
+cctggaaaggcacgtcagagagggtgacagccccgtgtgcgacactgccgggcagggcca
+ccactgtcttcagagagtcgggttgtttgggaatgcagcccaaagtgggtggtaaactcc
+atctaaagctaaatatgggcacgagaccgatagcaaacaagtaccgtgagcggaaaaaaa
+aaaaaaaAAAAAAAAAAAAAAANTTGGGGCCCCCCCCCCCCCNNCAATTTTTAATCCAAA
+AAATTTTTTTTTGGGGGCCCCATTTNGGGCCCTTTGGGCAATTTCCCCCTTAAGGGGG
View
2  test/data/extract/contaminated_empty_clean.csv
@@ -0,0 +1,2 @@
+query sequence id;hit accession number;sgi;evalue;species;subject annotation;subject score;kingdom
+AW5C3;XP_001629010;156372369;1.85315736381546e-09;Nota contamination;predicted protein;66.2401644268205;Porifera
View
11 test/data/extract/contaminated_empty_clean_target.fasta
@@ -0,0 +1,11 @@
+>AW5C3 [Astrosclera_willeyana]
+GGGTAATGTTGGGCTTNGATATGGTCAAGCCGGGAAGTTATAAACCAAGCTTTTAAATTA
+ATGTTTNTGGAATAGGANAANNAAAGAGGGCAACAGTCCCGTGAGCGAAAAGAATTTGGC
+TTCCTGAACGTTATTCCCAAGTACTATGGGATAGCCTAAACCTGTAGGAATCTAGGAGGA
+CCACCTCCTAAGGCTAAATATGACTTGGCGACCGTGAAATTGAGTTTGGTGGACCAGGAG
+CAAGATGTCAGAGAAGTTTGGAGACGTTCGTGTCCGTGATGCTGGCCAATATATTGTCAA
+GAACTTTCGCTCATTTCCTCAGTTTGTCGGTCGGTTGATACAGACCTACAGAGCAACATA
+CATCACCTGCAAGACTGTCCGAATGACACCTTACTTCCACATCGTTGGGGTGGCCATCGC
+AATAAACTATATGATTGATTACAAGTACCACTTGAAGTATGAGAAACTGCGCAAATACCA
+CTGAACATTGAACCAAGTTGTACTCACACCTTGTCACATCTGTATAGACACAAAGGTCCA
+TCATATGGTGCTGCATTGTATGCC
View
0  test/data/extract/contaminated_empty_contaminated.csv
No changes.
View
0  test/data/extract/contaminated_empty_contaminated_target.fasta
No changes.
View
138 test/data/extract/truncated.fasta
@@ -0,0 +1,138 @@
+>AW5C4 [Astrosclera_willeyana]
+CGGCCGGGCAGCACAACTTCTAACGGTGGACCCCTCGGCTCGTGCATCGATGAAGAACGC
+AGCAAACTGCGATACGTAGTGTGAATTGCAGAATTCAGTGAATCATCGAGTCTTTGAACG
+CAAATGGCGCTCCCGGTCAAGCCGGGAGCACGTCTGTCTGAGCGTCCTTTTCATTGAAGT
+GCAAGCCTTGCGTTTGCAGTGATTTGAGGAGTTGTCGAGTGCCTTTCCGAGTCGCCGGCA
+TCCCTTGAAGTCGTGCACTGTCCGTCACAGACAGCCAAGTGCAGGAGAGTTGCTTGCGCT
+TGGACTTCTGTGCGAGACTTGTGTTGAGAGCCCACTTTTGTACAGTTGgacctcagatca
+ggcgaggctacctgctgaacttaagcatatcaataagcagaggaaaagaaactaacaagg
+attcccccagtaacggcgagcgaagtgggaaaagctcgagcctgaaatctctggcagttg
+atgccagcgaattgtggccgggagaggcagctggaccctggctagcgctgtcgaagttga
+cctggaaaggcacgtcagagagggtgacagccccgtgtgcgacactgccgggcagggcca
+ccactgtcttcagagagtcgggttgtttgggaatgcagcccaaagtgggtggtaaactcc
+atctaaagctaaatatgggcacgagaccgatagcaaacaagtaccgtgagcggaaaaaaa
+aaaaaaaAAAAAAAAAAAAAAANTTGGGGCCCCCCCCCCCCCNNCAATTTTTAATCCAAA
+AAATTTTTTTTTGGGGGCCCCATTTNGGGCCCTTTGGGCAATTTCCCCCTTAAGGGGG
+>AW3C1 [Astrosclera_willeyana]
+CGGCCGGGCAGCACAACTTCTAACGGTGGACCCCTCGGCTCGTGCATCGATGAAGAACGC
+AGCAAACTGCGATACGTAGTGTGAATTGCAGAATTCAGTGAATCATCGAGTCTTTGAACG
+CAAATGGCGCTCCCGGTCAAGCCGGGAGCACGTCTGTCTGAGCGTCCTTTTCATTGAAGT
+GCAAGCCTTGCGTTTGCAGTGATTTGAGGAGTTGTCGAGTGCCTTTCCGAGTCGCCGGCA
+TCCCTTGAAGTCGTGCACTGTCCGTCACAGACAGCCAAGTGCAGGAGAGTTGCTTGCGCT
+TGGACTTCTGTGCGAGACTTGTGTTGAGAGCCCACTTTTGTACAGTTGgacctcagatca
+ggcgaggctacctgctgaacttaagcatatcaataagcagaggaaaagaaactaacaagg
+attcccccagtaacggcgagcgaagtgggaaaagctcgagcctgaaatctctggcagttg
+atgccagcgaattgtggccgggagaggcagctggaccctggctagcgctgtcgaagttga
+cctggaaaggcacgtcagagagggtgacagccccgtgtgcgacactgccgggcagggcca
+ccactgtcttcagagagtcgggttgtttgggaatgcagcccaaagtgggtggtaaactcc
+atctaaagctaaatatgggcacgagaccgatagcaaacaagtaccgtgagcggaaaaaaa
+aaaaaaaAAAAAAAAAAAAAAANTTGGGGCCCCCCCCCCCCCNNCAATTTTTAATCCAAA
+AAATTTTTTTTTGGGGGCCCCATTTNGGGCCCTTTGGGCAATTTCCCCCTTAAGGGGG
+>AW4C1 [Astrosclera_willeyana]
+GGCCGGGGGTTGGTGCTTCAGCTCCNAAAGAAGTGACTTGTGGTGTGAAAGCTCTTGTTT
+GGTGAAGTGTCAGACTCTCCCTCCATCTAGTCAGAATGTGCGACGAGGACGTTGCTGCGT
+TGGTTGTCGACAACGGCTCCGGCATGTGCAAAGCCGGGTTCGCCGGGGATGATGCACCTC
+GCGCTGTGTTCCCTTCCATCGTGGGCCGCCCTCGTCACCAGGGCGTGATGGTGGGTATGG
+GCCAGAAGGACTCGTACGTCGGCGATGAGGCCCAGAGCAAGAGAGGTATCCTCACCCTCA
+AGTACCCCATCGAGCACGGTATCGTTACCAACTGGGACGACATGGAGAAGATCTGGCATC
+ACACCTTCTACAACGAGCTGCGTGTTGCGCCCGAGGAGCACCCCGTTCTCCTAACAGAGG
+CGCCCCTCAACCCCAAGGCCAACCGCGAGAAGATGACCCAGATCATGTTCGAGACGTTCA
+ATACACCAGCCATGTACGTCGCCATTCAGGCCGTGCTCTCGCTGTACACCTCTGGTCGTA
+CCACCGGTATCGTGTTCGATTCTGGCGACGGAGTCTCCCACACCGTGCCCATCTACGAGG
+GATACGCCCTCCCACACGCCATCCTTCGTCTCGACCTCGCCGGGCGTGATCTGACAGACG
+ACCTGATGAAGATCCTCACCGAGCGTGGCTACTCGTTCACCACAACGGCAGAGCGTGAAA
+TCGTGCGTGACATCAAGGAGAAGCTGTGCTACGTGGCACTAGACTTTGAGCAGGAGATGC
+AAACAGCTGCCTCCAGCTCCAGCATCGAGAAGAGTTATGAGCTTCCTGATGGACAGGTTA
+TCACCATTGGAAACGAGCGCTTTCCGGGCCCCCAAGGCCCTCTTCCGCCCCAGCTTCCGG
+GGAATGGGAGCCGGTGGGATCCTTGAAACCCTGTTCAACCTCCTTCTTGAAAGGGGATTT
+AAACATTTCTAAGGGATCCCTTCCTCTAATACCGGGCTTTCTTGGGGGGGCAGTCAAATG
+TTTCCCTGGGATTTGTTAAAAAAAAGGGAAAAAGGAAAAATCCGAACTTTTTGGCCCCCC
+CCAACCCCTGAAAAATATAAAAAACTTTTGGCTCCCCCCCCAAGAAGGAAAATTTTTTCG
+GTTTGGGATTTGGGGGGGCCCCCTCTCTTTTGGGTTTCTTTCTCCCCCTCCCTCTCCCGC
+AAAAAATTGGGGATTTTTTCCAAAAGCGGGGAGAAATTTTATAAAAAAAATTGGGGGGAG
+ACCCTTTCCCCTTTTGTTTCCACCCCCCCCCCAAAGGGGGTTTTTTTTTTTTTGAGAAAA
+CCACCCCACCCCCCCAACCCCCCGCTGGTAAA
+>AW4C2 [Astrosclera_willeyana]
+TTTTTTTTCAAACCAAATACTTTTTNTGAATGGTGTGTGCACAAACTCAGCAAAACAGAT
+ACAAACCTGCATGATCACACACTACATATGCATATCACAAGAGAAAAAACACACTAATCT
+GTTAAAACTAGTGTTGTGTACTAAGAGTTCAGGTTTGGGTGCTCAGAAGCACTTGCGGTG
+GACAATGGAAGGTCCCGATTCGTCATACTCCTGCTTTGAGATCCACATCTGCTGGAAGGT
+GGAGAGAGAAGCCAAGATGGAGCCACCAATCCATACTGAATACTTCCTCTCGGGAGGAGC
+AATGATCTTAATCTTCATGGTTGGGGGAGCCAGAGCTACGATCTCCTTTTGCATTCTGTC
+AGCAATGCCAGGGAACATTGTACTGCCACCAGAGAGCACAGTATTAGCGTAGAGATCCTT
+ACGAATGTCTACATCACACTTCATGATGGAGTTGTAGCAGGTTTCATGGATGCCAGCCGA
+CTCCATTCCCAGGAAGCTGGGCTGGAAGAGGGCCTCGGGGCACCGGAAGCGCTCGTTTCC
+AATGGTGATAACCTGTCCATCAGGAAGCTCATAACTCTTCTCGATGCTGGAGCTGGAGGC
+AGCTGTTTGCATCTCCTGTTCAAAGTCTAGTGCTACGTAGCACAGCTTCTCCTTGATGTC
+ACGCACGATTTCACGCTCTGCCGTTGTGGTGAACGAGTAGCCACGCTCGGTGAGGATCTT
+CATCAGGTAGTCTGTCAGATCACGCCCGGCGAGGTCGAGACGAAGGATGGCGTGTGGGAG
+GGCGTATCCCTCGTAGATGGGCACGGTATGTGAGACTCCGTCGCCAGAATCGAACACGAT
+ACCGGTGGTACGGCCAGAGGCGTACAGCGAGAGCACGGCCTGGATGGCGACGTACATGGC
+TGGTGTGTTGAAGGTCTCGAACATGATCTGGGTCATCTTCTCGCGGTTGGCCTTGGGGTT
+GAGGGGCGCCTCTGTTAGGAGAACGGGGTGCTCCTCGGGCGCAACACGCAGCTCGTTGTA
+GAAGGTGTGATGCCAGATCTTCTCCATGTCGTCCCAGTTAGTAACGATACCGTGCTCGAT
+GGGGTACTTGAGGGTGAGGATACCTCTCTTACTCTGGGCCTCATCGCCGACGTACGAGTC
+CTTCTGGCCCATACCCACCATCACGCCCTGGTGACGAGGGCGGCCCACGATGGAAGGAAA
+CACAGCGCGAGGTGCATCATCGCCGGCGAACCCGGCTTTGCACATGCCGGAACCGTTATC
+AACAACCAACGCAGCAACGTCCTCGTCGCACATTTTGAAGCGTGAAGTTAGGAGGAAGAA
+AGCAAGAGTACACACTCCACGATGCTCCAATCAAAAGAAAGTCCCTCGGTCCGAAAGCCC
+TTGGGGGG
+>AW5C1 [Astrosclera_willeyana]
+TACGGCCGGGTATCAGCTACTAAGGGCTTACGGTGGATGCCTTGGCGCCAGGTAGCGATG
+AAGGGCGTGACAAACTGCGATAAGCTTCGGGTAGTTGTTTAGTAAACATTGATCCGGAGA
+TCCCCGAATCGGGCAACCGGGCAGGCTTTGCCTGTCATCTCGGCGTAAGTCGGGAGGCTA
+ACCAGGAGAAGTGAAGCATCTCAGTAACCTGAGGAACAGAAAGAAAACTCGATTCCCCCA
+GTAGTGGCGAGCGAAAAGGGAATAGCCTAAACTGGGTATATGTTAAAGTCCATTTACGTT
+GTATACCTGGGGTTGTGGGGTAATGTTGGGCTTGAATATGGTCAAGCCGGGAAGTTATAA
+ACCAAGTTTTTAGCTTAATGTTTCTGGAATAGGACAACCAAAGAGGGTAACAGTCCCGTG
+AGCGAAAAGAATTTGGCTTCCTGAACGTTATTCCCAAGTACTATGGGATAGCCTAAACCT
+GTAGGAATCTAGGAGGACCACCTCCTAAGGCTAAATATGACTTGGCGACCGATAGTGAAG
+AAGTACTACaaaaaaaaaaaaaaaaaaaaaaaaaaaaGTgggggcccccccgcccccgcc
+cTTTTTTAATTCGAAAAATTTTTTTGGGGGGGCCCAATTTGGGGTCTTTTGGGCATTTTC
+CCCTTTTGGGGGGGGT
+>AW5C2 [Astrosclera_willeyana]
+TACGGCCGGGGANTTGGCGACCGATAGTGAAGAAGTACTGTGAAGGAAAGGTGAACAGTC
+CCCCCGCTAGGGAAGTGAAATAGTCCCTGAAACCGTACAGCCTACAAGCTGTGGAAGTGC
+TAAGTCTCGATCCGTCGAGACATGCATGACTGCGTGCCTTTTGCATAATGAGCCGGCGAC
+TTACTCTGTGTAGCAAGGTTAAGCTTTTCTGAAGCGTAGCCGTAGCGAAGGCGAGTCTGA
+ATAGGGCGATAGAGTTGCATGGAGTAgacccgaaactgggtgatctatccatgggcaagg
+tgaagcatacgtaaaagtatgtggaggcctgaacccaccaaggctgaaaacttgggggat
+gacctgtggatcggagtgaaaggctaatcaaacccagtgatagctggttctccccgaaat
+AGCTTTAGGGCTAGCCTCATGTGTTTGGCAGTGGTGGTAGAGCTCTGATTGGACTAGCGG
+CCCCACCAGGTTAGCAACTCCAGTTAAACTGCAAATGCCATTGTCTTAAAGCATGGGAGT
+CAGTCAGTAGGGGATAAGCTCTACTGACAAAAGGGATAAGAGCCCAGATCGCCAGCTAAG
+GTCCCCAAATACAGGCTAAGTGGTAAAGGATGTGTCGTTGCCCAGACAGCCAGGATGTTG
+GCTTAGAAGCAGCCATTCATTTAAAGAGTGCGTAATAGCTCACTGGTCAAGTGGCTTTGC
+ACCGAAAATTCTCGGGGCTTAAGCCTGTTACCGAAGCTGCGGATTTTGACCCACGTACCG
+GTTCGCCGACAGCGGGGTTGAAGTGGTAGGGGAGCGTTCTATAGTAGGATGAAGGTATGT
+CAAAGTACGGTCTTTCTATGTACATATTTTTAACACCTTCCCCTACTCTGGGAGTGATTG
+AAAACTGTAACCACCTAATTCTCTGTAATACCTGTGGTGCCGTGGAAAAGAAAAACCATT
+TTTTTTTAACTCCATTCTCTCCCCCAAGCCCCAAAGGATTAAACAATCGGAAAAAAGTTT
+AGTTTTCCGCTCCCCCATTAAAAGGATGAAAGTAAGGCACATCTAAGGCTTAAGCGATCC
+AACATGCGGAAGGTAGTGCATGGTTCACTCCCCAACAGAAGGGAACTTCAGTTAAAATCC
+GTAGTTTCATTAACTCTTAAAACGTTATCTGGATTCTCGTTAGGAATACAATCTGGTCCT
+ACTTTTCTACTCAACAAAAACAACCTTTAGTGGTACACGTAAATGTCCTCCCAAACTCCT
+ACACCGTACCCGGTGAGCTCAACTATAGAATCCTAATCGTGTCTCCATAAGAATTCTCCC
+TAATGATACCTACCCCAAAAAAAACAAAAGGAAAAAAAAAAAACAAACATAGGTGCTCCC
+TCTCCCTCATTAGACCCAATATATTCGACCAGCTTAATTTTTTCTCTCTCGCCTCTACTT
+TATCTTCATTTATTCTCCATCCCCCTCAAAGTAGAAAATAATAAAAAAAAATCAAAAACA
+CTTTNTTTAATCTCCATTTTCTCTTCTCTCCTCCCTCTAACACCTCCACAACACCAACGC
+CTTATATAACTTTGTAACACACACTTTGTAAATTACTACTAACCAATGTCATCATACATA
+TTTCTTATTCACTTACACCACATCCAAGCTAAACTAAGACTTCCAATTAGATATACCTAC
+CCCCTGAATGCATCCATTCTATAATCTCATCCTTCATCTCATAATCAACTTCGTTGTTCT
+CTGCCCACCCTCCATCTCTGTTCTGCTATCTCCTGCATTTCCTAGCTCTCACTCCATTCC
+CACCCCTGAACTTTCCTCTCTTTTCATACCCTACTGCTTGCCTTCTATTTTCTGACTCCA
+TTAACTTCGCTTCCATTAACTACTGCGTTCTTTCTATCTCTCACTAAACTGCACCCTCAC
+TCATTTCTTACTCTACCCCTCTCTCCCNCCCTTCATGCTTCTCTTTTAATACTATCCCAT
+TCGTCCACATCTCCCTCATTCATCG
+>AW5C3 [Astrosclera_willeyana]
+GGGTAATGTTGGGCTTNGATATGGTCAAGCCGGGAAGTTATAAACCAAGCTTTTAAATTA
+ATGTTTNTGGAATAGGANAANNAAAGAGGGCAACAGTCCCGTGAGCGAAAAGAATTTGGC
+TTCCTGAACGTTATTCCCAAGTACTATGGGATAGCCTAAACCTGTAGGAATCTAGGAGGA
+CCACCTCCTAAGGCTAAATATGACTTGGCGACCGTGAAATTGAGTTTGGTGGACCAGGAG
+CAAGATGTCAGAGAAGTTTGGAGACGTTCGTGTCCGTGATGCTGGCCAATATATTGTCAA
+GAACTTTCGCTCATTTCCTCAGTTTGTCGGTCGGTTGATACAGACCTACAGAGCAACATA
+CATCACCTGCAAGACTGTCCGAATGACACCTTACTTCCACATCGTTGGGGTGGCCATCGC
+AATAAACTATATGATTGATTACAAGTACCACTTGAAGTATGAGAAACTGCGCAAATACCA
+CTGAACATTGAACCAAGTTGTACTCACACCTTGTCACATCTGTATAGACACAAAGGTCCA
+TCATATGGTGCTGCATTGTATGCC
View
49 test/test_blackbox_extract.rb
@@ -3,13 +3,56 @@
class BlackBoxTest < Test::Unit::TestCase
- SPLIT_DATADIR = "test/data/extract"
+ EXTRACT_DATADIR = "test/data/extract"
+ EXTRACT_BINARY = "bin/phyta-extract"
- context "Command line output" do
+ context "Extract command line output" do
should "print default message if run without parameters" do
- result = %x[bin/phyta-extract]
+ result = %x[#{EXTRACT_BINARY}]
expected = "Invalid arguments, see --help for more information."
assert_equal expected.strip, result.strip
end
end
+
+ context "Extracting" do
+ should "work if the clean file is empty" do
+ Dir.mktmpdir do |dir|
+ result = %x[#{EXTRACT_BINARY} -c #{EXTRACT_DATADIR}/clean_empty_clean.csv -d #{EXTRACT_DATADIR}/clean_empty_contaminated.csv -f #{EXTRACT_DATADIR}/truncated.fasta -o #{dir}/clean_empty_clean_out.fasta -p #{dir}/clean_empty_contaminated_out.fasta]
+
+ clean_result = File.open("#{dir}/clean_empty_clean_out.fasta").read
+ contaminated_result = File.open("#{dir}/clean_empty_contaminated_out.fasta").read
+
+ clean_target = File.open("#{EXTRACT_DATADIR}/clean_empty_clean_target.fasta").read
+ contaminated_target = File.open("#{EXTRACT_DATADIR}/clean_empty_contaminated_target.fasta").read
+
+ assert_not_nil clean_result
+ assert_not_nil contaminated_result
+ assert_not_nil clean_target
+ assert_not_nil contaminated_target
+
+ assert_equal clean_target, clean_result, "Clean files differ"
+ assert_equal contaminated_target, contaminated_result, "Contaminated files differ"
+ end
+ end
+ should "work if the contaminated file is empty" do
+ Dir.mktmpdir do |dir|
+ result = %x[#{EXTRACT_BINARY} -c #{EXTRACT_DATADIR}/contaminated_empty_clean.csv -d #{EXTRACT_DATADIR}/contaminated_empty_contaminated.csv -f #{EXTRACT_DATADIR}/truncated.fasta -o #{dir}/contaminated_empty_clean_out.fasta -p #{dir}/contaminated_empty_contaminated_out.fasta]
+
+ clean_result = File.open("#{dir}/contaminated_empty_clean_out.fasta").read
+ contaminated_result = File.open("#{dir}/contaminated_empty_contaminated_out.fasta").read
+
+ clean_target = File.open("#{EXTRACT_DATADIR}/contaminated_empty_clean_target.fasta").read
+ contaminated_target = File.open("#{EXTRACT_DATADIR}/contaminated_empty_contaminated_target.fasta").read
+
+ assert_not_nil clean_result
+ assert_not_nil contaminated_result
+ assert_not_nil clean_target
+ assert_not_nil contaminated_target
+
+ assert_equal clean_target, clean_result, "Clean files differ"
+ assert_equal contaminated_target, contaminated_result, "Contaminated files differ"
+ end
+ end
+ end
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.