galaxy-dist commit ba34d996fff5: Merge.
# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User Dannon Baker <dannonbaker@me.com> # Date 1289568520 18000 # Node ID ba34d996fff5669eca98ff98c6035a68ac93bd34 # Parent 2389c323a1e6a50de6d48d5431d16d830ccef021 # Parent a6cd0223a53b4f9498a0dde69dcef53387188e5f Merge. --- a/templates/requests/common/events.mako +++ /dev/null @@ -1,53 +0,0 @@ -<%inherit file="/base.mako"/> -<%namespace file="/message.mako" import="render_msg" /> - -<% - is_admin = cntrller == 'requests_admin' and trans.user_is_admin() - can_edit_request = ( is_admin and not request.is_complete ) or request.is_unsubmitted - can_reject_request = is_admin and request.is_submitted - can_add_samples = request.is_unsubmitted -%> - -<br/><br/> -<ul class="manage-table-actions"> - <li><a class="action-button" id="request-${request.id}-popup" class="menubutton">Request Actions</a></li> - <div popupmenu="request-${request.id}-popup"> - <a class="action-button" href="${h.url_for( controller='requests_common', action='view_request', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Browse this request</a> - %if can_edit_request: - <a class="action-button" href="${h.url_for( controller='requests_common', action='edit_basic_request_info', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Edit this request</a> - %endif - %if can_add_samples: - <a class="action-button" confirm="More samples cannot be added to this request once it is submitted. Click OK to submit." href="${h.url_for( controller='requests_common', action='submit_request', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Submit this request</a> - %endif - %if can_reject_request: - <a class="action-button" href="${h.url_for( controller='requests_admin', action='reject_request', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Reject this request</a> - %endif - </div> -</ul> - -%if message: - ${render_msg( message, status )} -%endif - -<h2>History of Sequencing Request "${request.name}"</h2> - -<div class="toolForm"> - <table class="grid"> - <thead> - <tr> - <th>State</th> - <th>Last Update</th> - <th>Comments</th> - </tr> - </thead> - <tbody> - %for state, updated, comments in events_list: - <tr class="libraryRow libraryOrFolderRow" id="libraryRow"> - <td><b><a>${state}</a></b></td> - <td><a>${updated}</a></td> - <td><a>${comments}</a></td> - </tr> - %endfor - </tbody> - </table> -</div> --- a/tools/ncbi_blast_plus/blast_filter_fasta.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python -"""Filter a FASTA file using tabular output, e.g. from BLAST. - -Takes five command line options, tabular BLAST filename, ID column number -(using one based counting), input FASTA filename, and two output FASTA -filenames (for records with and without any BLAST hits). - -In the default NCBI BLAST+ tabular output, the query sequence ID is in column -one, and the ID of the match from the database is in column two. -""" -import sys -from galaxy_utils.sequence.fasta import fastaReader, fastaWriter - -#Parse Command Line -blast_file, blast_col, in_file, out_positive_file, out_negative_file = sys.argv[1:] -blast_col = int(blast_col)-1 -assert blast_col >= 0 - -#Read tabular BLAST file and record all queries with hit(s) -ids = set() -blast_handle = open(blast_file, "rU") -for line in blast_handle: - ids.add(line.split("\t")[blast_col]) -blast_handle.close() - -#Write filtered FASTA file based on IDs from BLAST file -reader = fastaReader(open(in_file, "rU")) -positive_writer = fastaWriter(open(out_positive_file, "w")) -negative_writer = fastaWriter(open(out_negative_file, "w")) -for record in reader: - #The [1:] is because the fastaReader leaves the > on the identifer. - if record.identifier and record.identifier.split()[0][1:] in ids: - positive_writer.write(record) - else: - negative_writer.write(record) -positive_writer.close() -negative_writer.close() -reader.close() --- a/tools/ncbi_blast_plus/blast_filter_fasta.xml +++ /dev/null @@ -1,37 +0,0 @@ -<tool id="blast_filter_fasta" name="Filter FASTA using BLAST output" version="0.0.1"> - <description>Divide a FASTA file based on BLAST hits</description> - <command interpreter="python"> - blast_filter_fasta.py $blast_file $blast_col $in_file $out_positive_file $out_negative_file - </command> - <inputs> - <param name="in_file" type="data" format="fasta" label="FASTA file to filter"/> - <param name="blast_file" type="data" format="tabular" label="Tabular BLAST output"/> - <param name="blast_col" type="select" label="Column containing FASTA identifiers"> - <option value="1">Column 1 - BLAST query ID</option> - <option value="2">Column 2 - BLAST match ID</option> - </param> - </inputs> - <outputs> - <data name="out_positive_file" format="fasta" label="Sequences with BLAST hits" /> - <data name="out_negative_file" format="fasta" label="Sequences without BLAST hits" /> - </outputs> - <requirements> - </requirements> - <tests> - </tests> - <help> - -**What it does** - -Typical use would be to take a multi-sequence FASTA and the tabular output of -running BLAST on it, and divide the FASTA file in two: those sequence with a -BLAST hit, and those without. - -In the default NCBI BLAST+ tabular output, the query sequence ID is in column -one, and the ID of the match from the database is in column two. - -This allows you to filter the FASTA file for the subjects in the BLAST search, -rather than filtering the FASTA file for the queries in the BLAST search. - - </help> -</tool>
participants (1)
-
commits-noreply@bitbucket.org