Skip to content

Commit

Permalink
ready for pip package
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusdv committed Dec 11, 2015
1 parent 64bf842 commit 4b38417
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include README.md LICENSE
include README.md LICENSE filtus/man/* filtus/man/pictures/* filtus/data/* filtus/testfiles/*
2 changes: 1 addition & 1 deletion filtus/Filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def getPos(v): return int(getPosStr(v))
reader = VariantFileReader.VariantFileReader()

def test_comphetTrio():
test = "example_files\\multiallelic_tests.vcf"; ch_fa_mo=[0,1,2]
test = "testfiles\\multiallelic_tests.vcf"; ch_fa_mo=[0,1,2]
vflist = reader.readVCFlike(test, sep="\t", chromCol="CHROM", posCol="POS", geneCol="Gene_INFO", splitAsInfo="INFO", keep00=1)
VFch, VFfa, VFmo = [vflist[i] for i in ch_fa_mo]
res = trioRecessiveFilter(VFch, VFfa, VFmo, "Recessive")
Expand Down
28 changes: 21 additions & 7 deletions filtus/Filtus.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,29 @@
import FiltusUtils
import InputDialog


try:
SCRIPT_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
except NameError:
# For py2exe
try:
sys.stdout = open("filtus.log", 'w')
except Exception:
pass

if hasattr(sys, 'executable'):
SCRIPT_DIR = os.path.abspath(os.path.join(os.path.dirname(sys.executable), '..'))
else:
print "Can't get script path"


# module FiltusQC is imported in a try clause - to check availability of numpy and matplotlib.
try:
import FiltusQC
PLOT_error = None
except ImportError as e:
print 'plot import error'
print e
PLOT_error = e

SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))

class FiltusGUI(object):
def __init__(self, parent):
Expand Down Expand Up @@ -660,10 +674,10 @@ def main():
#root.mainloop() # moved to bottom of file

printVF = FiltusAnalysis._printVF
test_csv = ["example_files\\test%d.csv" %i for i in (1,2)]
test_vcf = "example_files\\vcf_test.vcf"
test_csv = ["testfiles\\test%d.csv" %i for i in (1,2)]
test_vcf = "testfiles\\vcf_test.vcf"
controltrio = "C:\\testfiles\\trioControl\\hg002_hg003_hg004.hg19_multianno.hgmd.header.txt"
test_trio = "example_files\\trioHG002_22X.vcf"
test_trio = "testfiles\\trioHG002_22X.vcf"

def test_version():
'''checks that the correct version number is used when saving output files'''
Expand Down Expand Up @@ -800,7 +814,7 @@ def test_advancedload():
print "Testing advanced load........",
filtus.clearAll()
filtus.advLoad = FiltusWidgets.AdvancedLoad(filtus)
filtus.advLoad.dirEntry.setvalue("example_files")
filtus.advLoad.dirEntry.setvalue("testfiles")
filtus.advLoad.endswithEntry.setvalue(".vcf")
filtus.advLoad.endswithVar.set(1)
filtus.advLoad_prompt()
Expand Down
2 changes: 1 addition & 1 deletion filtus/FiltusAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ def _printVF(VF, truncate=10):
reader = VariantFileReader.VariantFileReader()

def test_denovo():
test = "example_files\\trio1000.vcf"; frqCol="1000g2014oct_all"; ch_fa_mo=[0,1,2]
test = "testfiles\\trioHG002_22X.vcf"; frqCol="1000g2014oct_all"; ch_fa_mo=[0,1,2]
vflist = reader.readVCFlike(test, sep="\t", chromCol="VCF_CHR", posCol="VCF_POS", geneCol="Gene.refGene", formatCol="VCF_FORMAT",splitAsInfo="", keep00=1)
VFch, VFfa, VFmo = [vflist[i] for i in ch_fa_mo]
dn = DeNovoComputer()
Expand Down
2 changes: 1 addition & 1 deletion filtus/VariantFileReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def process(line):

if __name__ == "__main__":
reader = VariantFileReader()
testfile = "example_files\\test_file.csv"
testfile = "testfiles\\test_file.csv"
vflist = reader.readVCFlike(testfile, sep=",", chromCol="CHROM", posCol="POS", geneCol="Gene", splitAsInfo="INFO", keep00=1)
assert vflist[0].length == 425
vflist = reader.readVCFlike(testfile, sep=",", chromCol="CHROM", posCol="POS", geneCol="Gene", splitAsInfo="INFO", keep00=1, prefilter=("contain", "splic"))
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
},
'package_data': {
'filtus': [
'man/*/*',
'man/pictures/*.png',
'man/*.html',
'data/*',
'testfiles/*'
]
Expand Down

0 comments on commit 4b38417

Please sign in to comment.