mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
First pass at fixing behavior of Compute phastOdds score, small enhancement to Subtract Whole Query.
This commit is contained in:
@@ -30,6 +30,11 @@ def main():
|
||||
except Exception, e:
|
||||
print e
|
||||
cookbook.doc_optparse.exit()
|
||||
|
||||
if h5_fname == 'None.h5':
|
||||
print 'Invalid genome build - this tool currently only works with data from genome build hg17. Click "edit attributes" (the pencil icon) in your history item to correct the genome build if appropriate.'
|
||||
sys.exit()
|
||||
|
||||
# Open the h5 file
|
||||
h5 = openFile( h5_fname, mode = "r" )
|
||||
# Load intervals and names for the subregions
|
||||
|
||||
@@ -15,9 +15,36 @@
|
||||
<data format="interval" name="output" metadata_source="input"/>
|
||||
</outputs>
|
||||
<help>
|
||||
|
||||
.. class:: warningmark
|
||||
|
||||
Append a column to each line of an interval file containing the
|
||||
phastOdds score for that interval.
|
||||
This tool currently only works with interval data from genome build hg17.
|
||||
|
||||
.. class:: warningmark
|
||||
|
||||
This tool assumes that the input dataset is in interval format and contains at least a chrom column, a start column and an end column. These 3 columns can be dispersed throughout any number of other data columns.
|
||||
|
||||
-----
|
||||
|
||||
**Syntax**
|
||||
|
||||
Append a column to each line of an interval file containing the phastOdds score for that interval.
|
||||
|
||||
-----
|
||||
|
||||
**Example**
|
||||
|
||||
If your original data has the following format:
|
||||
|
||||
+-----+-----+---+
|
||||
|chrom|start|end|
|
||||
+-----+-----+---+
|
||||
|
||||
and you choose to compute phastCons scores, your output will look like this:
|
||||
|
||||
+-----+-----+---+-----+
|
||||
|chrom|start|end|score|
|
||||
+-----+-----+---+-----+
|
||||
|
||||
</help>
|
||||
</tool>
|
||||
|
||||
@@ -15,7 +15,7 @@ def get_lines(fname):
|
||||
for i, line in enumerate(file(fname)):
|
||||
line = line.strip()
|
||||
lines.add( line )
|
||||
return lines
|
||||
return (i+1, lines)
|
||||
|
||||
def main():
|
||||
# Parsing Command Line here
|
||||
@@ -32,14 +32,19 @@ def main():
|
||||
print >> sys.stderr, "Unable to open output file"
|
||||
sys.exit()
|
||||
|
||||
lines1 = get_lines(inp1_file)
|
||||
lines2 = get_lines(inp2_file)
|
||||
len1, lines1 = get_lines(inp1_file)
|
||||
diff1 = len1 - len(lines1)
|
||||
len2, lines2 = get_lines(inp2_file)
|
||||
|
||||
lines1.difference_update(lines2)
|
||||
|
||||
for line in lines1:
|
||||
print >> fo, line
|
||||
|
||||
fo.close()
|
||||
|
||||
|
||||
if diff1 > 0:
|
||||
print "Eliminated %d duplicate lines from first query." %diff1
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
**Syntax**
|
||||
|
||||
This tool subtracts an entire query from another query. Any text format is valid.
|
||||
This tool subtracts an entire query from another query. Any text format is valid. This tool assumes that each query consists of distinct lines of data (i.e., duplicate lines are eliminated from both queries prior to subtraction). If any duplicate lines were eliminated from the first query, the number is displayed in the resulting history item.
|
||||
|
||||
-----
|
||||
|
||||
|
||||
Reference in New Issue
Block a user