Skip to content
Snippets Groups Projects
Commit d61ebb73 authored by Holger Brandl's avatar Holger Brandl
Browse files

extract blasttest method

parent 8629a08b
No related branches found
No related tags found
No related merge requests found
......@@ -120,3 +120,4 @@ createCuffDbTrickyDisk(getwd(), gtfFile, genomeBuild)
' | R -q --no-save --no-restore --args $1 $2
}
export -f MakeCuffDB
......@@ -44,3 +44,34 @@ mmCountFastGzReads(){
export -f mmCountFastGzReads
##http://www.biostars.org/p/16471/
## estimate blast progress for fasta-query files. Result files are assumed to have the fasta id in column 1
BlastProgress(){
if [ $# -eq 0 ]; then echo "Usage: BlastProgress <blast_query_fasta>+"; return; fi
for query in $* ; do
# query=$1
blast=$query.blast.out
# echo "the blast out is: "$blast
#echo "the fasta query is: "$query
#curquery=$(tail -1 $blast | cut -f 1)
# http://tldp.org/LDP/abs/html/fto.html
if [ -s $blast ]; then
# echo "file exists and has non-zero size"
curquery=$(tail -1 $blast | cut -f 1)
curline=$(grep -n $curquery"$" $query | cut -f 1 -d ':')
else
# echo "file does not yet exist or is empty"
curline=0
fi
nblines=$(wc -l $query | cut -f 1 -d " ")
percent=$(echo "($curline/$nblines) *100" | bc -l | cut -c 1-4)
echo "Approximately $percent % of $query were processed."
done
}
export -f BlastProgress
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment