[Bio] / FigTutorial / show_similarities.py Repository:
ViewVC logotype

View of /FigTutorial/show_similarities.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Thu Jun 10 14:51:56 2004 UTC (15 years, 5 months ago) by disz
Branch: MAIN
CVS Tags: merge-bodev_news-3, rast_rel_2014_0912, rast_rel_2008_06_18, rast_rel_2008_06_16, rast_rel_2008_07_21, rast_rel_2010_0928, rast_2008_0924, Root-bobdev_news, rast_rel_2008_09_30, caBIG-13Feb06-00, rast_rel_2010_0526, rast_rel_2014_0729, merge-trunktag-bobdev_news-1, rast_rel_2009_05_18, caBIG-05Apr06-00, rast_rel_2009_0925, rast_rel_2010_1206, rast_rel_2010_0118, caBIG-00-00-00, rast_rel_2009_02_05, rast_rel_2011_0119, rast_rel_2008_12_18, merge-trunktag-bodev_news-3, merge-bobdev_news-2, merge-bobdev_news-1, rast_rel_2008_10_09, rast_release_2008_09_29, rast_rel_2008_04_23, rast_rel_2008_08_07, rast_rel_2009_07_09, rast_rel_2010_0827, myrast_33, rast_rel_2011_0928, rast_rel_2008_09_29, rast_rel_2008_10_29, rast_rel_2009_03_26, merge-trunktag-bobdev_news-2, rast_rel_2008_11_24, HEAD
Branch point for: Branch-bobdev_news
Python version of tutorial code

from FigKernelPackages import FIG
import sys, string

fig = FIG.FIG()
id1_ix = 0
ln1_ix = 12
id2_ix = 1
ln2_ix = 13
iden_ix = 2
psc_ix = 10
ali_ln_ix = 3
mismatches_ix = 4
gaps_ix = 5
bsc_ix = 11
b1_ix = 6
e1_ix = 7
b2_ix = 8
e2_ix = 9
bit_score_ix = 11
tool_ix = 14
def2_ix = 15
ali_ix = 16


def die(msg):
	print msg
	sys.exit(0)

if len(sys.argv) != 5:
	die("usage: show_similarities PEG CutOFF MaxReturned Expand")


peg = sys.argv[1]
cutoff = sys.argv[2]
max = sys.argv[3]
expand = sys.argv[4]

sims = fig.sims(peg, max, cutoff, "all", expand)

for sim in sims:
    ln1    = str(sim[ln1_ix])
    id2    = str(sim[id2_ix])
    ln2    = str(sim[ln2_ix])
    pscore = str(sim[psc_ix])
    iden   = str(sim[iden_ix])
    b1     = str(sim[b1_ix])
    e1     = str(sim[e1_ix])
    b2     = str(sim[b2_ix])
    e2     = str(sim[e2_ix])
    func2  = fig.function_of(id2)
    print string.join((ln1, id2, ln2, pscore, iden, b1, e1, b2, e2, func2[1]), "\t")

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3