details: http://www.bx.psu.edu/hg/galaxy/rev/cd1bcec32519 changeset: 2384:cd1bcec32519 user: guru date: Wed Apr 29 16:32:23 2009 -0400 description: Added functional tests for testing sniffing and metadata settings of qual454 and qualsolid datatypes.
6 file(s) affected in this change:
datatypes_conf.xml.sample lib/galaxy/datatypes/qualityscore.py lib/galaxy/datatypes/registry.py test-data/qualscores.qual454 test-data/qualscores.qualsolid test/functional/test_sniffing_and_metadata_settings.py
diffs (194 lines):
diff -r 656f1df80b46 -r cd1bcec32519 datatypes_conf.xml.sample --- a/datatypes_conf.xml.sample Wed Apr 29 14:47:18 2009 -0400 +++ b/datatypes_conf.xml.sample Wed Apr 29 16:32:23 2009 -0400 @@ -188,7 +188,6 @@ <sniffer type="galaxy.datatypes.sequence:Maf"/> <sniffer type="galaxy.datatypes.sequence:Lav"/> <sniffer type="galaxy.datatypes.sequence:csFasta"/> - <sniffer type="galaxy.datatypes.qualityscore:QualityScoreSolexa"/> <sniffer type="galaxy.datatypes.qualityscore:QualityScoreSOLiD"/> <sniffer type="galaxy.datatypes.qualityscore:QualityScore454"/> <sniffer type="galaxy.datatypes.sequence:Fasta"/> diff -r 656f1df80b46 -r cd1bcec32519 lib/galaxy/datatypes/qualityscore.py --- a/lib/galaxy/datatypes/qualityscore.py Wed Apr 29 14:47:18 2009 -0400 +++ b/lib/galaxy/datatypes/qualityscore.py Wed Apr 29 16:32:23 2009 -0400 @@ -152,35 +152,4 @@ except: return "Solexa Quality score file (%s)" % ( data.nice_size( dataset.get_size() ) )
- def sniff( self, filename ): - """ - >>> fname = get_test_fname( 'sequence.fasta' ) - >>> QualityScoreSolexa().sniff( fname ) - False - >>> fname = get_test_fname( 'sequence.qualsolexa' ) - >>> QualityScoreSolexa().sniff( fname ) - True - """ - try: - fh = open( filename ) - readlen = None - while True: - line = fh.readline() - if not line: - break #EOF - line = line.strip() - if line and not line.startswith( '#' ): - if len(line.split('\t')) > 1: - break - try: - [ int( x ) for x in line.split() ] - if not(readlen): - readlen = len(line.split()) - assert len(line.split()) == readlen #Solexa reads should be of the same length - except: - break - - except: - pass - return False - + \ No newline at end of file diff -r 656f1df80b46 -r cd1bcec32519 lib/galaxy/datatypes/registry.py --- a/lib/galaxy/datatypes/registry.py Wed Apr 29 14:47:18 2009 -0400 +++ b/lib/galaxy/datatypes/registry.py Wed Apr 29 16:32:23 2009 -0400 @@ -159,6 +159,9 @@ xml.BlastXml(), sequence.Maf(), sequence.Lav(), + sequence.csFasta(), + qualityscore.QualityScoreSOLiD(), + qualityscore.QualityScore454(), sequence.Fasta(), sequence.FastqSolexa(), interval.Wiggle(), diff -r 656f1df80b46 -r cd1bcec32519 test-data/qualscores.qual454 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/qualscores.qual454 Wed Apr 29 16:32:23 2009 -0400 @@ -0,0 +1,49 @@ +>EYKX4VC04IWAEA length=68 xy=3531_0528 region=4 run=R_2007_11_07_16_15_57_ +22 13 9 6 4 3 2 2 1 1 1 1 24 44 33 23 16 11 7 2 28 33 23 18 28 27 27 28 20 21 42 35 21 6 24 25 31 21 28 27 41 34 15 28 28 27 28 28 33 24 27 28 28 24 27 36 27 28 28 28 +28 28 36 30 8 34 25 18 +>EYKX4VC04JKOGH length=48 xy=3808_3903 region=4 run=R_2007_11_07_16_15_57_ +28 28 27 28 38 31 10 28 28 27 27 34 25 28 24 26 27 28 27 37 29 34 25 31 21 28 21 36 28 31 20 24 27 37 28 28 34 27 3 34 25 24 28 28 26 28 35 28 +>EYKX4VC04JIUVK length=84 xy=3788_0830 region=4 run=R_2007_11_07_16_15_57_ +29 20 14 11 8 6 3 1 25 27 25 28 28 27 28 27 28 28 36 28 27 28 36 29 7 28 28 28 27 27 27 35 26 35 26 27 36 28 28 28 38 32 11 28 36 28 27 26 35 25 28 38 31 11 27 28 37 28 27 27 +28 36 29 8 33 24 41 34 19 3 26 28 28 28 35 26 36 29 8 38 32 11 28 28 +>EYKX4VC04JWDRY length=78 xy=3942_1068 region=4 run=R_2007_11_07_16_15_57_ +36 24 14 5 27 20 28 27 28 32 22 28 27 43 36 23 11 27 28 28 28 32 23 36 27 28 28 26 38 32 11 34 25 27 43 36 23 11 38 31 11 37 28 28 28 27 28 30 20 28 32 22 28 36 27 37 30 9 27 28 +28 27 28 42 35 20 5 28 28 28 35 26 27 27 26 39 32 12 +>EYKX4VC04JWMUW length=55 xy=3945_0550 region=4 run=R_2007_11_07_16_15_57_ +36 24 14 4 28 17 34 25 35 25 31 20 28 28 36 27 28 28 24 27 28 28 37 28 27 27 35 25 31 21 27 39 32 12 28 36 28 28 26 27 28 27 26 28 42 35 20 6 28 27 28 28 28 28 28 +>EYKX4VC04JH4RG length=85 xy=3779_3850 region=4 run=R_2007_11_07_16_15_57_ +37 28 35 26 38 31 10 27 37 28 28 38 31 10 27 35 25 25 28 28 28 28 28 28 28 28 27 28 33 23 28 32 22 35 25 31 20 34 25 31 21 26 28 27 26 26 15 36 29 7 27 27 24 36 27 28 37 28 36 28 +27 28 28 28 37 28 28 40 34 14 37 28 28 26 28 36 28 26 28 37 28 28 28 28 27 +>EYKX4VC04JDAWO length=117 xy=3724_3814 region=4 run=R_2007_11_07_16_15_57_ +25 28 28 28 34 25 28 28 28 28 28 28 28 27 27 30 19 28 28 34 25 28 28 26 32 23 28 28 27 28 28 34 25 28 27 28 25 25 36 27 36 29 7 36 27 33 23 28 28 36 27 31 21 28 30 20 28 34 24 28 +27 34 25 28 28 28 28 28 28 27 28 27 37 30 9 28 28 27 28 27 28 28 28 27 33 23 28 28 28 17 28 31 20 28 21 26 28 33 23 26 28 27 26 28 35 26 28 28 21 28 26 28 33 23 36 27 27 +>EYKX4VC04JEY0S length=57 xy=3743_3898 region=4 run=R_2007_11_07_16_15_57_ +23 28 35 28 6 26 24 27 33 23 26 28 28 28 28 33 27 3 27 30 19 28 28 36 27 33 24 24 32 23 25 26 27 28 31 21 34 27 5 28 22 27 28 24 26 28 28 27 28 24 37 29 26 35 26 26 15 +>EYKX4VC04JKOGB length=68 xy=3808_3897 region=4 run=R_2007_11_07_16_15_57_ +28 34 27 4 27 28 24 28 28 28 28 27 27 31 20 28 27 27 26 28 35 26 37 28 28 28 28 28 41 34 19 4 35 26 27 32 22 28 25 36 28 26 28 28 25 36 29 8 28 28 28 27 24 28 41 34 16 27 21 28 +21 26 33 26 21 40 34 14 +>EYKX4VC04JOZA4 length=160 xy=3857_3886 region=4 run=R_2007_11_07_16_15_57_ +35 24 15 7 1 26 28 41 34 15 28 28 28 28 28 27 25 40 34 14 28 28 44 35 24 15 8 2 27 24 27 27 35 26 28 27 36 27 26 36 28 24 27 37 29 27 28 26 35 26 28 28 28 27 26 35 26 37 29 36 +28 28 26 36 28 28 28 37 28 28 28 28 28 28 28 28 36 28 43 36 22 10 19 37 28 27 37 28 24 27 37 28 38 32 11 28 37 29 26 25 34 25 36 27 24 25 24 36 27 23 27 28 39 32 12 39 32 12 28 37 +29 25 27 27 27 24 28 39 32 12 28 26 44 36 24 14 5 33 26 2 33 24 26 24 28 28 27 35 25 34 25 26 41 34 16 43 36 22 8 28 +>EYKX4VC04JLDPN length=75 xy=3816_3865 region=4 run=R_2007_11_07_16_15_57_ +28 28 36 27 28 28 36 27 28 27 28 28 28 27 26 36 27 28 28 27 28 28 28 28 28 28 28 28 27 28 40 33 14 28 28 28 40 33 13 24 27 28 28 28 27 23 32 22 25 18 26 21 24 36 27 26 24 25 28 26 +27 37 28 22 28 28 34 24 28 25 23 26 23 25 27 +>EYKX4VC04IEKBT length=167 xy=3329_0983 region=4 run=R_2007_11_07_16_15_57_ +26 17 12 9 7 5 4 2 1 28 44 31 21 15 11 8 5 2 34 25 44 35 24 15 7 1 35 26 37 29 28 36 27 37 28 28 27 36 27 27 39 32 12 36 27 28 37 28 28 35 26 36 27 28 28 24 27 27 28 28 +28 36 27 40 33 14 27 28 43 36 23 12 2 28 27 27 36 27 43 36 22 8 27 37 28 35 25 28 28 28 28 36 27 41 35 16 39 32 12 28 36 28 28 27 28 38 31 11 28 27 28 28 28 37 28 35 25 28 39 33 +13 28 28 28 28 28 26 26 28 28 27 27 28 27 25 39 32 12 28 28 35 25 25 27 28 28 28 26 36 27 28 28 35 25 28 28 34 25 28 27 36 28 26 28 28 28 28 +>EYKX4VC04H76LH length=104 xy=3256_2259 region=4 run=R_2007_11_07_16_15_57_ +20 12 7 5 3 2 2 1 1 1 1 1 1 28 30 19 26 28 33 23 27 37 28 28 36 28 28 37 28 28 36 28 27 42 35 21 7 27 27 30 19 31 21 28 27 33 23 28 28 28 27 35 25 28 35 26 27 36 27 28 +36 27 28 36 27 28 36 27 28 36 28 28 36 28 28 36 27 27 35 25 27 33 23 28 36 27 28 31 21 28 35 25 27 34 25 28 33 23 28 32 22 26 34 24 +>EYKX4VC04I6APD length=156 xy=3645_0543 region=4 run=R_2007_11_07_16_15_57_ +21 12 8 5 4 2 2 1 1 1 1 1 1 28 38 32 11 28 44 36 24 14 5 24 28 28 28 21 27 42 35 21 7 27 28 27 24 26 28 37 28 35 26 28 26 28 27 24 28 28 27 28 44 18 9 5 3 2 1 1 +1 1 1 1 1 1 1 1 1 35 26 41 34 17 25 24 12 28 28 27 38 32 11 28 28 23 28 27 28 27 20 39 32 12 22 26 36 27 27 27 24 36 28 28 36 27 35 26 40 33 18 1 26 34 27 28 24 22 40 34 +15 26 32 22 28 28 28 25 28 28 39 33 13 27 28 32 22 32 23 42 35 21 7 28 43 36 23 10 27 43 36 23 10 36 28 25 +>EYKX4VC04IPT6U length=143 xy=3457_2692 region=4 run=R_2007_11_07_16_15_57_ +30 20 15 11 8 5 3 1 28 19 27 34 24 44 36 23 13 3 28 35 25 28 27 28 28 28 28 27 35 25 28 36 27 27 28 28 28 28 36 27 36 28 28 42 35 21 6 28 28 27 27 44 35 24 15 8 1 27 27 28 +36 27 28 28 27 28 28 35 26 43 36 23 12 2 28 36 27 26 28 28 36 27 28 28 36 27 41 34 16 25 28 41 34 16 36 28 40 34 14 39 33 13 36 27 40 34 18 2 28 40 34 18 2 35 25 28 27 41 34 19 +4 26 27 28 27 28 28 34 25 36 27 28 28 28 36 27 37 28 28 27 28 27 28 +>EYKX4VC04JX6Y2 length=68 xy=3962_3644 region=4 run=R_2007_11_07_16_15_57_ +28 28 28 27 35 28 6 27 28 27 36 27 28 25 37 28 33 26 2 28 27 28 24 28 37 29 28 28 28 28 28 23 28 32 22 28 36 27 28 26 34 25 28 28 35 26 28 28 26 27 25 28 28 24 28 28 27 27 28 28 +28 28 33 23 28 40 34 14 \ No newline at end of file diff -r 656f1df80b46 -r cd1bcec32519 test-data/qualscores.qualsolid --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/qualscores.qualsolid Wed Apr 29 16:32:23 2009 -0400 @@ -0,0 +1,48 @@ +>946_21_302_F3 +2 10 2 2 4 2 21 2 2 4 4 17 5 2 5 2 11 4 2 2 2 10 7 3 15 2 2 2 3 19 3 2 6 3 2 +>946_21_659_F3 +3 31 3 2 2 2 34 3 2 2 2 31 2 2 3 4 31 8 3 2 2 30 4 8 3 3 2 2 6 9 4 4 6 2 2 +>946_21_1071_F3 +5 5 2 2 2 8 5 3 2 3 7 7 2 3 4 6 5 2 2 2 5 5 2 2 2 3 8 2 3 3 3 8 2 3 2 +>946_21_1115_F3 +21 5 2 8 13 31 6 2 17 24 10 27 4 21 29 8 20 2 11 21 13 24 5 5 6 24 31 2 13 6 22 17 6 27 10 +>946_21_1218_F3 +11 21 2 13 13 16 27 16 19 27 22 28 14 26 24 23 29 10 15 13 6 4 7 16 26 22 11 6 16 22 21 6 4 7 21 +>946_21_1232_F3 +17 16 2 28 21 31 15 16 10 11 8 20 6 5 18 6 13 23 7 13 4 12 19 8 6 9 10 19 7 10 6 10 20 14 8 +>946_21_1368_F3 +28 30 31 31 31 20 29 24 27 31 31 31 24 26 31 31 26 15 27 31 27 30 29 27 30 27 30 21 23 26 24 31 17 30 19 +>946_21_1406_F3 +4 29 3 2 4 5 34 8 2 2 3 29 4 2 8 2 11 4 2 2 2 28 8 5 3 4 31 2 2 2 2 28 5 2 2 +>946_21_1695_F3 +25 31 8 29 19 31 19 12 16 31 30 13 16 21 31 22 13 13 19 23 32 16 6 14 16 24 13 6 6 14 8 8 5 11 6 +>946_21_1945_F3 +23 27 14 10 17 31 29 31 10 13 31 29 23 8 24 30 31 28 10 20 26 28 31 5 22 31 24 28 9 7 15 7 20 5 4 +>946_21_2013_F3 +2 26 2 2 2 2 2 2 9 2 2 2 2 2 2 2 2 4 2 2 2 2 3 2 2 2 2 2 2 2 2 2 4 2 2 +>946_22_108_F3 +17 14 12 28 12 17 18 28 19 13 14 6 17 5 3 6 2 7 6 12 16 7 13 9 11 8 2 5 5 6 6 7 20 11 19 +>946_22_1241_F3 +16 8 5 20 11 6 13 5 19 13 8 9 17 31 8 17 2 6 31 21 12 11 8 12 5 8 15 8 5 5 7 5 11 6 10 +>946_22_1296_F3 +10 8 33 31 27 31 26 5 17 11 6 23 8 24 6 8 14 14 27 11 16 8 8 29 5 21 8 5 14 8 7 16 4 5 5 +>946_22_1356_F3 +2 31 4 3 2 6 31 4 2 2 4 2 3 8 2 2 2 3 4 8 2 2 3 3 11 2 2 2 4 2 2 2 9 2 2 +>946_22_1520_F3 +8 11 12 21 13 15 16 25 20 21 14 23 31 23 30 18 25 23 27 30 21 30 15 14 25 22 22 21 21 22 16 23 26 13 21 +>946_22_1532_F3 +27 30 34 26 25 29 31 31 24 29 29 33 28 22 24 31 30 30 24 22 25 31 19 9 26 29 23 22 13 28 30 31 24 7 29 +>946_22_1582_F3 +28 19 4 5 6 25 30 4 5 8 15 19 5 9 8 29 27 4 4 2 27 17 2 2 5 30 22 2 11 6 26 16 3 2 2 +>946_22_1598_F3 +23 5 33 6 19 8 13 4 30 17 11 13 6 16 8 8 27 5 24 8 8 26 16 8 17 2 23 25 4 23 10 16 10 7 13 +>946_22_1834_F3 +31 28 30 31 31 34 27 29 31 28 31 29 16 31 31 25 31 11 27 21 26 29 16 18 21 19 29 13 24 24 27 24 8 24 10 +>946_22_1939_F3 +30 29 31 31 25 31 33 24 31 30 25 31 27 33 31 27 31 26 30 19 16 27 29 31 21 25 27 9 26 27 23 15 20 27 27 +>946_23_975_F3 +31 31 3 3 2 32 29 3 3 4 28 27 2 4 4 30 24 3 7 3 28 24 5 7 8 29 22 2 6 6 2 24 2 2 2 +>946_23_1133_F3 +19 28 22 31 25 14 28 30 32 27 10 33 26 31 31 14 30 30 16 30 10 28 23 16 6 14 17 10 6 8 18 5 8 9 5 +>946_23_1221_F3 +30 26 30 32 23 29 29 27 28 20 26 23 14 29 27 29 28 29 23 14 30 27 30 27 8 24 13 26 11 12 20 17 15 5 21 \ No newline at end of file diff -r 656f1df80b46 -r cd1bcec32519 test/functional/test_sniffing_and_metadata_settings.py --- a/test/functional/test_sniffing_and_metadata_settings.py Wed Apr 29 14:47:18 2009 -0400 +++ b/test/functional/test_sniffing_and_metadata_settings.py Wed Apr 29 16:32:23 2009 -0400 @@ -114,6 +114,18 @@ self.check_history_for_string( 'NCBI Blast XML data' ) self.check_history_for_string( 'format: <span class="blastxml">blastxml</span>' ) self.delete_history_item( 1 ) + def test_65_qualsolid_datatype( self ): + """Testing correctly sniffing qualsolid data type upon upload""" + self.upload_file( 'qualscores.qualsolid' ) + self.verify_dataset_correctness('qualscores.qualsolid') + self.check_history_for_string('qualscores.qualsolid format: <span class="qualsolid">qualsolid</span>, database: ? Info: uploaded qualsolid file') + self.delete_history_item( 1 ) + def test_70_qual454_datatype( self ): + """Testing correctly sniffing qual454 data type upon upload""" + self.upload_file( 'qualscores.qual454' ) + self.verify_dataset_correctness('qualscores.qual454') + self.check_history_for_string('qualscores.qual454 format: <span class="qual454">qual454</span>, database: ? Info: uploaded qual454 file') + self.delete_history_item( 1 ) def test_9999_clean_up( self ): self.delete_history() self.logout()
galaxy-dev@lists.galaxyproject.org