From 345111630ebd32af2b0d6f1bb057d651a65cc050 Mon Sep 17 00:00:00 2001 From: Migun Shakya Date: Fri, 20 Jul 2018 14:44:44 -0600 Subject: [PATCH] removing gff file name from file names --- pypiret/Runs/Summ.py | 11 +++++------ tests/test_pipeline_linux.sh | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pypiret/Runs/Summ.py b/pypiret/Runs/Summ.py index b4375a8..c1f67e8 100644 --- a/pypiret/Runs/Summ.py +++ b/pypiret/Runs/Summ.py @@ -42,18 +42,17 @@ def output(self): if ',' in self.gff: gff_list = self.gff.split(",") gff_full_path = [os.path.abspath(gff) for gff in gff_list] - gtfs = [self.workdir + "/" + gff.split("/")[-1].split(".gff")[0] + ".gtf" for gff in gff_full_path] all_target = [] for gffs in gff_full_path: feature = list(set(pd.read_csv(gffs, sep="\t", header=None, comment='#')[2].tolist())) - loc_target = [LocalTarget(counts_dir + os.path.basename(gffs) + "_" + feat + "_count.tsv") for feat in feature] + loc_target = [LocalTarget(counts_dir + feat + "_count.tsv") for feat in feature] all_target = loc_target + all_target return all_target else: gff_fp = os.path.abspath(self.gff) features = list(set(pd.read_csv(gff_fp, sep="\t", header=None, comment='#')[2].tolist())) features = [feat for feat in features if feat in ['CDS', 'rRNA', 'tRNA', 'exon', 'gene', 'transcript']] - loc_target = LocalTarget(counts_dir + "/" + os.path.basename(self.gff).split(".gff")[0] + "_" + features[-1] + "_count.tsv") + loc_target = LocalTarget(counts_dir + "/" + features[-1] + "_count.tsv") return loc_target def run(self): @@ -83,12 +82,12 @@ def run(self): "-g", self.fid, "-t", feat, "-T", self.num_cpus, - "-o", counts_dir + "/" + gffs.split("/")[-1].split("gff")[0] + "_" + feat + "_count.tsv"] + in_srtbam_list + "-o", counts_dir + "/" + feat + "_count.tsv"] + in_srtbam_list fcount_cmd = featureCounts[fcount_cmd_opt] fcount_cmd() else: feature = list(set(pd.read_csv(self.gff, sep="\t", header=None, - comment='#')[2].tolist())) + comment='#')[2].tolist())) for feat in feature: if feat in ['CDS', 'rRNA', 'tRNA', 'exon', 'gene', 'transcript', 'novel_region']: @@ -99,7 +98,7 @@ def run(self): "-g", self.fid, "-t", feat, "-T", self.num_cpus, - "-o", counts_dir + "/" + self.gff.split("/")[-1].split(".gff")[0] + "_" + feat + "_count.tsv"] + in_srtbam_list + "-o", counts_dir + "/" + feat + "_count.tsv"] + in_srtbam_list fcount_cmd = featureCounts[fcount_cmd_opt] fcount_cmd() diff --git a/tests/test_pipeline_linux.sh b/tests/test_pipeline_linux.sh index d50a10f..b35eeb5 100644 --- a/tests/test_pipeline_linux.sh +++ b/tests/test_pipeline_linux.sh @@ -18,12 +18,12 @@ printf "${blue}testing pipeline with prokarya only\n${normal}" printf "bin/runPiReT -d tests/test_prok -e test_prok.txt \ -gp tests/data/test_prok.gff \ --i tests/test_prok/prok_index -k prokarya -m all \ +-i tests/test_prok/prok_index -k prokarya -m DEedge \ -fp tests/data/test_prok.fa --config luigi.cfg" bin/runPiReT -d tests/test_prok -e test_prok.txt \ -gp tests/data/test_prok.gff \ --i tests/test_prok/prok_index -k prokarya -m all \ +-i tests/test_prok/prok_index -k prokarya -m DEedge \ -fp tests/data/test_prok.fa --config luigi.cfg printf "${blue}fininshed testing pipeline for prokarya only\n${normal}"