QA Python Tools: Difference between revisions

From Genecats
Jump to navigationJump to search
No edit summary
No edit summary
Line 3: Line 3:
~/kent/python/lib/ucscGb/qa/</pre>
~/kent/python/lib/ucscGb/qa/</pre>


To properly import a package, function, or class, make sure you have the <code>~/kent/python/lib/ucscGb/</code> directory specified in your <code>PYTHONPATH</code> variable. The <code>PYTHONPATH</code> works similarly to the <code>PATH</code> variable inside of the <code>.bashrc</code> file. You can add the following line to your <code>.bashrc</code> file to import packages from the /ucscGb directory:
To properly import a package, function, or class, make sure you have the <code>~/kent/python/lib/</code> directory specified in your <code>PYTHONPATH</code> variable. The <code>PYTHONPATH</code> works similarly to the <code>PATH</code> variable inside of the <code>.bashrc</code> file. You can add the following line to your <code>.bashrc</code> file to import packages from the /ucscGb directory:
<pre>
<pre>
export PYTHONPATH=$PYTHONPATH:~/kent/python/lib/</pre>
export PYTHONPATH=$PYTHONPATH:~/kent/python/lib/</pre>

Revision as of 21:37, 6 February 2019

This page contains information about the different python modules and functions. The QA python scripts live in the following directory:

~/kent/python/lib/ucscGb/qa/

To properly import a package, function, or class, make sure you have the ~/kent/python/lib/ directory specified in your PYTHONPATH variable. The PYTHONPATH works similarly to the PATH variable inside of the .bashrc file. You can add the following line to your .bashrc file to import packages from the /ucscGb directory:

export PYTHONPATH=$PYTHONPATH:~/kent/python/lib/

Then, to import the package, you can use the following line:

from ucscGb.qa.tables import trackUtils

You can call a function inside of the trackUtils python script by using the following syntax:

trackUtils.getLabels(db, track, labelType)

tables/trackUtils.py

def getLabels(db, track, labelType):
Returns labels of specified 'type' (shortLabel or longLabel) for a single track, its parent, and its superTrack. Excludes 'view' labels.
  • Depends on getAttributeForTrack within tables/trackUtils.py
def getAttributeForTrack(attribute, db, track):
Uses tdbQuery to get an attribute where track or table == 'track' and removes label.
  • Depeneds on runCommand within qaUtils.py