Preliminary commity for lca. Still in progress.

This commit is contained in:
Anton Nekrutenko
2009-01-19 12:12:36 -05:00
parent 8df7dd16ea
commit 2c85c6fee9
4 changed files with 159 additions and 40 deletions
+74 -33
View File
@@ -6,47 +6,88 @@
<meta name="generator" content="Docutils 0.3.9: http://docutils.sourceforge.net/" />
<title></title>
<link rel="stylesheet" href="style/base.css" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.3.9: http://docutils.sourceforge.net/" />
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/"/>
<script src="http://www.apple.com/library/quicktime/scripts/ac_quicktime.js" language="JavaScript" type="text/javascript"></script>
<script src="http://www.apple.com/library/quicktime/scripts/qtp_library.js" language="JavaScript" type="text/javascript"></script>
<link href="http://www.apple.com/library/quicktime/stylesheets/qtp_library.css" rel="StyleSheet" type="text/css" />
<link rel="stylesheet" href="style/base.css" type="text/css" />
</head>
</head>
<body>
<div class="document">
<div class="donemessage">
<strong>Workflows are finally here!</strong>
<hr>
Watch how you can (<i>Click link to play</i>)...
<ul>
<li><a target="_blank" href="http://screencast.g2.bx.psu.edu/galaxy/WorkFlow_SC4/">Create Workflows by Example</a>: Convert your Galaxy History into a Workflow.</li>
<li><a target="_blank" href="http://screencast.g2.bx.psu.edu/galaxy/WorkFlow_SC5/">Edit Workflows</a>: I want to repeat an analysis...but...with different parameters.</li>
<li><a target="_blank" href="http://screencast.g2.bx.psu.edu/galaxy/WorkFlow_SC7/">Workflows from scratch</a>: Drag, drag, drag...</li>
</ul>
<hr>
For more screencasts click <a target="_blank" href="http://galaxy.psu.edu/screencasts.html">here</a>.
</div>
<hr>
<div class="warningmessage">
<strong>The Galaxy Main Server was recently upgraded.</strong>
<div class="section" align="center">
<strong>Unsequenced Genomes of the World</strong> | October 2008
<br>
<br>
<img src="images/welcomePhoto.jpg" border="0">
<br>
Costa's hummingbird (<i>Calypte costae</i>) | Kings Canyon NP, California
<br>
<br>
<hr>
There was some instability as Galaxy was restarted numerous times between 8:30 and 10:00 AM EST (UTC -0500) this morning (Wednesday, January 14). Any jobs from this time that ended in error can be tried again. If you continue to have any problems, please contact the Galaxy Team by using the 'report this error' link within a red history item, or emailing <a href="mailto:galaxy-bugs@bx.psu.edu">galaxy-bugs@bx.psu.edu</a>.
</div>
<p/>
<div class="infomessage">
<strong>We are hiring!</strong>
<hr>
Thanks to your support and an unprecedented level of usage, we are looking for an experienced software developer to join our team. For more information about this position, please, click <a target="_blank" href="https://www.bx.psu.edu/cgi-bin/trac.cgi/galaxy/wiki/PythonDeveloper">here</a>.
</div>
<hr>
<div class="welcomeBlue">
<strong>Galaxy is for Biologists</strong>
<br>
Use this site to access popular sources of data like the UCSC Table Browser. Run analyses right on the spot using a variety of integrated tools. Your results are always available and can be easily shared with others. Just <a target="_blank" href="http://g2.trac.bx.psu.edu/wiki/ScreenCasts">watch</a> how.
</div>
<br>
<div class="welcomeRed">
<strong>Galaxy is for Developers</strong>
<br>
Galaxy is an easy-to-use, open-source, scalable framework for tool and data integration. Stop wasting time writing interfaces and get your tools used by biologists! Galaxy includes everything you need to get started, so <a target="_blank" href="http://g2.trac.bx.psu.edu/wiki/HowToInstall">download</a> and start <a target="_blank" href="http://g2.trac.bx.psu.edu/wiki/HowToInstall">integrating</a>!
</div>
<div class="welcomeBlue" id="screencasts" align="center">
<strong>Introducing Galactic Quickies</strong>
<hr>
Galactic quickies are <i>super-short</i> screencasts that are <i>always</i> under 5 minutes. We thought it may be a good way to spread the word about Galaxy's functionality while keeping the &quot;annoyance factor&quot; to the minimum. The quickies will be updated weekly.
<hr>
<table width="100%" border="0" height="100%">
<tr>
<td valign="middle" align="center">
<br>
<script type="text/javascript"><!--
QT_WritePoster_XHTML('click to play', 'http://screencast.g2.bx.psu.edu/galaxy/quickie1_TabSeq/quickie1_TabSeq-poster.jpg',
'http://screencast.g2.bx.psu.edu/galaxy/quickie1_TabSeq/quickie1_TabSeq.mov',
'640', '480', '',
'controller', 'true',
'autoplay', 'true',
'bgcolor', '#CCCCFF',
'scale', 'aspect');
//-->
</script>
<noscript>
<object width="640" height="480" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="http://screencast.g2.bx.psu.edu/galaxy/quickie1_TabSeq/quickie1_TabSeq.jpg" />
<param name="href" value="http://screencast.g2.bx.psu.edu/galaxy/quickie1_TabSeq/quickie1_TabSeq.mov" />
<param name="target" value="myself" />
<param name="controller" value="false" />
<param name="autoplay" value="false" />
<param name="scale" value="aspect" />
<embed width="640" height="480" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"
src="http://screencast.g2.bx.psu.edu/galaxy/quickie1_TabSeq/quickie1_TabSeq.jpg"
href="http://screencast.g2.bx.psu.edu/galaxy/quickie1_TabSeq/quickie1_TabSeq.mov"
target="myself"
controller="false"
autoplay="false"
scale="aspect">
</embed>
</object>
</noscript>
</td>
</tr>
</table>
<br>
For a high resolution version <a target="_blank" class="reference" href="http://screencast.g2.bx.psu.edu/galaxy/quickie1_TabSeq/">click here</a>.
<br>
<hr>
</div>
<hr>
<p><a target="_blank" class="reference" href="http://g2.trac.bx.psu.edu/wiki/GalaxyTeam">Galaxy team</a> is a part of <a target="_blank" class="reference" href="http://www.bx.psu.edu">BX</a> at <a target="_blank" class="reference" href="http://www.psu.edu">Penn State</a>.</p>
<hr class="docutils" /> This project is supported in part by <a target="_blank" class="reference" href="http://www.nsf.gov">NSF</a> and <a target="_blank" class="reference" href="http://www.huck.psu.edu">the Huck Institutes of the Life Sciences</a>.
<p><small>Galaxy build: <b>$Rev$</b></small></p>
+6 -1
View File
@@ -71,7 +71,8 @@ taxRank = {
'genus' :20,
'subgenus' :21,
'species' :22,
'subspecies' :23
'subspecies' :23,
'order' :13
}
@@ -157,12 +158,16 @@ try:
for item in cur.fetchall():
out_string = '%s\t%s\t%d\t' % ( item[0], item[1], item[2] )
out_string += rankName
out_string += '\t'
out_string += str(taxRank[rankName])
print >>out_file, out_string
else:
cur.execute('select rank, count(*) from %s_count where N = 1 and length(rank)>1 group by rank' % rank)
for item in cur.fetchall():
out_string = '%s\t%s\t' % ( item[0], item[1] )
out_string += rankName
out_string += '\t'
out_string += str(taxRank[rankName])
print >>out_file, out_string
except Exception, e:
stop_err("%s\n" % e)
+44 -3
View File
@@ -14,6 +14,32 @@ def main():
try:
inputfile = sys.argv[1]
outfile = sys.argv[2]
rank_bound = int( sys.argv[3] )
"""
Mapping of ranks:
root :2,
superkingdom:3,
kingdom :4,
subkingdom :5,
superphylum :6,
phylum :7,
subphylum :8,
superclass :9,
class :10,
subclass :11,
superorder :12,
order :13,
suborder :14,
superfamily :15,
family :16,
subfamily :17,
tribe :18,
subtribe :19,
genus :20,
subgenus :21,
species :22,
subspecies :23,
"""
except:
stop_err("Syntax error: Use correct syntax: program infile outfile")
group_col = 0
@@ -91,7 +117,16 @@ def main():
out_list[k+1] = 'n'
k += 1
print >>fout, '\t'.join(out_list)
# print >>fout, '\t'.join(out_list)
if rank_bound == 0:
print >>fout, ''.join(out_list)
print 'n'*( 24 - rank_bound )
else:
print '\t'.join(out_list[rank_bound:24])
if ''.join(out_list[rank_bound:24]) != 'n'*( 24 - rank_bound ):
print >>fout, '\t'.join(out_list)
block_valid = True
prev_item = item
@@ -134,9 +169,15 @@ def main():
while k < 23:
out_list[k+1] = 'n'
k += 1
print >>fout, '\t'.join(out_list)
if rank_bound == 0:
print >>fout, '\t'.join(out_list)
else:
print ''.join(out_list[rank_bound:24])
print 'n'*( 24 - rank_bound )
if ''.join(out_list[rank_bound:24]) != 'n'*( 24 - rank_bound ):
print >>fout, '\t'.join(out_list)
if skipped_lines > 0:
msg= "Skipped %d invalid lines starting with line %d. Value '%s' in column %d is not numeric." % ( skipped_lines, first_invalid_line, invalid_value, invalid_column )
print msg
+35 -3
View File
@@ -1,12 +1,44 @@
<tool id="lca1" name="Least Common Ancestor" version="1.0.0">
<description></description>
<command interpreter="python">
lca.py $input1 $out_file1
lca.py $input1 $out_file1 $rank_bound
</command>
<inputs>
<param format="taxonomy" name="input1" type="data" label="Select taxonomy dataset"/>
<param format="taxonomy" name="input1" type="data" label="Select taxonomy dataset"/>
<param name="rank_bound" label="rank bound" type="select" help="Choose smallest diagnostic level">
<option value="0">Everything</option>
<option value="3">Superkingdom</option>
<option value="4">Kingdom</option>
<option value="5">Subkingdom</option>
<option value="6">Superphylum</option>
<option value="7">Phylum</option>
<option value="8">Subphylum</option>
<option value="9">Superclass</option>
<option value="10">Class</option>
<option value="11">Subclass</option>
<option value="12">Superorder</option>
<option value="13">Order</option>
<option value="14">Suborder</option>
<option value="15">Superfamily</option>
<option value="16">Family</option>
<option value="17">Subfamily</option>
<option value="18">Tribe</option>
<option value="19">Subtribe</option>
<option value="20">Genus</option>
<option value="21">Subgenus</option>
<option value="22">Species</option>
<option value="23">Subspecies</option>
</param>
</inputs>
<outputs>
<data format="taxonomy" name="out_file1" metadata_source="input1" />
</outputs>
</tool>
<help>
**What it does**
When performing metagenomic analyses it is often necessary to identify sequence reads corresponding to a particular taxonomic group, or, in other words, diagnostic of a particular taxonomic rank. This utility performs this analysis. It takes data generated by *Taxonomy manipulation->Fetch Taxonomic Ranks* as input and outputs either a list of sequence reads unique to a particular taxonomic rank, or a list of taxonomic ranks and the count of unique reads corresponding to each rank.
</help>
</tool>