Mercurial > repos > cropgeeks > flapjack
comparison flapjack.py @ 28:326e6b1e926c draft
Uploaded
| author | cropgeeks |
|---|---|
| date | Mon, 27 Feb 2017 11:08:35 -0500 |
| parents | 44c2d3b788f1 |
| children | 9f4041f700d8 |
comparison
equal
deleted
inserted
replaced
| 27:408a644e1e16 | 28:326e6b1e926c |
|---|---|
| 1 from galaxy.datatypes.data import Text | 1 from galaxy.datatypes.data import Tabular |
| 2 | 2 |
| 3 class FlapjackFormat(Text): | 3 class FlapjackFormat(Text): |
| 4 file_ext = "flapjack" | 4 file_ext = "flapjack" |
| 5 | 5 |
| 6 class FlapjackMapFormat(Text): | 6 class FlapjackMapFormat(Tabular): |
| 7 file_ext = "fjmap" | 7 file_ext = "fjmap" |
| 8 | 8 |
| 9 def sniff( self, filename ): | 9 def sniff( self, filename ): |
| 10 h = open(filename) | 10 h = open(filename) |
| 11 line = h.readline() | 11 line = h.readline() |
| 12 if line.rstrip() != "# fjFile = MAP": | 12 if line.rstrip() != "# fjFile = MAP": |
| 13 h.close() | 13 h.close() |
| 14 return False | 14 return False |
| 15 return True | 15 return True |
| 16 | 16 |
| 17 class FlapjackGenotypeFormat(Text): | 17 class FlapjackGenotypeFormat(Tabular): |
| 18 file_ext = "fjgenotype" | 18 file_ext = "fjgenotype" |
| 19 | 19 |
| 20 def sniff( self, filename ): | 20 def sniff( self, filename ): |
| 21 h = open(filename) | 21 h = open(filename) |
| 22 line = h.readline() | 22 line = h.readline() |
| 23 if line.rstrip() != "# fjFile = GENOTYPE": | 23 if line.rstrip() != "# fjFile = GENOTYPE": |
| 24 h.close() | 24 h.close() |
| 25 return False | 25 return False |
| 26 return True | 26 return True |
| 27 | 27 |
| 28 class FlapjackPhenotypeFormat(Text): | 28 class FlapjackPhenotypeFormat(Tabular): |
| 29 file_ext = "fjphenotye" | 29 file_ext = "fjphenotye" |
| 30 | 30 |
| 31 def sniff( self, filename ): | 31 def sniff( self, filename ): |
| 32 h = open(filename) | 32 h = open(filename) |
| 33 line = h.readline() | 33 line = h.readline() |
| 34 if line.rstrip() != "# fjFile = PHENOTYPE": | 34 if line.rstrip() != "# fjFile = PHENOTYPE": |
| 35 h.close() | 35 h.close() |
| 36 return False | 36 return False |
| 37 return True | 37 return True |
| 38 | 38 |
| 39 class FlapjackQtlFormat(Text): | 39 class FlapjackQtlFormat(Tabular): |
| 40 file_ext = "fjqtl" | 40 file_ext = "fjqtl" |
| 41 | 41 |
| 42 def sniff( self, filename ): | 42 def sniff( self, filename ): |
| 43 h = open(filename) | 43 h = open(filename) |
| 44 line = h.readline() | 44 line = h.readline() |
| 45 if line.rstrip() != "# fjFile = QTL": | 45 if line.rstrip() != "# fjFile = QTL": |
| 46 h.close() | 46 h.close() |
| 47 return False | 47 return False |
| 48 return True | 48 return True |
| 49 | 49 |
| 50 class FlapjackGraphFormat(Text): | 50 class FlapjackGraphFormat(Tabular): |
| 51 file_ext = "fjgraph" | 51 file_ext = "fjgraph" |
| 52 | 52 |
| 53 def sniff( self, filename ): | 53 def sniff( self, filename ): |
| 54 h = open(filename) | 54 h = open(filename) |
| 55 line = h.readline() | 55 line = h.readline() |
