diff --git a/script/trackrun.py b/script/trackrun.py index 1cf6bf7..e6e79aa 100644 --- a/script/trackrun.py +++ b/script/trackrun.py @@ -38,7 +38,7 @@ def __init__(self): The command contains: pre: prepare the run folder by separating the tracks from the same locus clusterj:run the trackcluster in junction mode to get the isoforms and the counting -cluster:run the trackcluster eon/intron intersection to get the isoforms and the counting +cluster:run the trackcluster exon/intron intersection to get the isoforms and the counting desc: compare the novel isoforms with the existing annotations to give an description for the min edit distance between a novel isoform with its nearest reference annotation test: run test for installation ------ @@ -63,7 +63,7 @@ def __init__(self): def map(self): parser = argparse.ArgumentParser( - description="minimap2 mapping/samtools process wrapper, will generate prefix_s.bam" + description="minimap2 mapping/samtools process wrapper, will generate prefix_s.bam\n" "trackrun.py -t 32 -g gemone.fa -f sample.fastq" ) parser.add_argument("-d", "--folder", default=os.getcwd(), diff --git a/trackcluster/batch.py b/trackcluster/batch.py index 8f9174d..088a607 100644 --- a/trackcluster/batch.py +++ b/trackcluster/batch.py @@ -21,7 +21,6 @@ # bar for run - #random.seed(1234) diff --git a/trackcluster/cluster.py b/trackcluster/cluster.py index 0b124a3..fd1b7a5 100644 --- a/trackcluster/cluster.py +++ b/trackcluster/cluster.py @@ -8,6 +8,8 @@ make dendrogram for further plotting The input is a list of """ +import os + # self import #from trackcluster.track import bigGenePred from trackcluster.utils import del_files @@ -145,6 +147,8 @@ def cal_distance(bigg_list, intronweight=0.5, by="ratio", tmpdir=None): :param by: used to cal the distance between two bigg object, can be "ratio", "ratio_short", "length", "length_short" :return: D: distance matrix """ + if tmpdir is None: + tmpdir=os.getcwd() bigg_list.sort(key=operator.attrgetter("chromStart")) for i in bigg_list: diff --git a/trackcluster/tracklist.py b/trackcluster/tracklist.py index 282a1fb..9e67279 100644 --- a/trackcluster/tracklist.py +++ b/trackcluster/tracklist.py @@ -157,6 +157,39 @@ def bigglist_to_bedfile(bigg_list,prefix=None, dir=None): return (out_exon, out_intron) +def bigglist_to_plotbed(bigglist, out): + """ + generate a bigglist which is ready for plotting from the bigglist + example as csv or tsv: + "","chrom","start","end","strand","isoform_name","tracknum","type" + "1","chrII",14647324,14647857,"-","ZC101.2g.1",1,"exon" + "2","chrII",14647919,14648142,"-","ZC101.2g.1",1,"exon" + "3","chrII",14648551,14648827,"-","ZC101.2g.1",1,"exon" + "4","chrII",14648885,14649435,"-","ZC101.2g.1",1,"exon" + "5","chrII",14649494,14649607,"-","ZC101.2g.1",1,"exon" + "6","chrII",14649650,14649798,"-","ZC101.2g.1",1,"exon" + "7","chrII",14649843,14650013,"-","ZC101.2g.1",1,"exon" + "8","chrII",14650060,14650279,"-","ZC101.2g.1",1,"exon" + "9","chrII",14650325,14650538,"-","ZC101.2g.1",1,"exon" + "10","chrII",14650593,14650898,"-","ZC101.2g.1",1,"exon" + "11","chrII",14651002,14651037,"-","ZC101.2g.1",1,"exon" + "12","chrII",14647858,14647918,"-","ZC101.2g.1",1,"intron" + "13","chrII",14648143,14648550,"-","ZC101.2g.1",1,"intron" + "14","chrII",14648828,14648884,"-","ZC101.2g.1",1,"intron" + "15","chrII",14649436,14649493,"-","ZC101.2g.1",1,"intron" + "16","chrII",14649608,14649649,"-","ZC101.2g.1",1,"intron" + "17","chrII",14649799,14649842,"-","ZC101.2g.1",1,"intron" + "18","chrII",14650014,14650059,"-","ZC101.2g.1",1,"intron" + "19","chrII",14650280,14650324,"-","ZC101.2g.1",1,"intron" + "20","chrII",14650539,14650592,"-","ZC101.2g.1",1,"intron" + "21","chrII",14650899,14651001,"-","ZC101.2g.1",1,"intron" + "22","chrII",14647324,14647857,"-","ZC101.2e.1",2,"exon" + :param bigglist: + :param out: + :return: + """ + + def wrapper_bedtools_intersect2(bedfile1,bedfile2,outfile=None): """ Using two bedfile to get the intsersection of pairs