Skip to content

Commit

Permalink
removing gff file name from file names
Browse files Browse the repository at this point in the history
  • Loading branch information
mshakya committed Jul 20, 2018
1 parent abe75bc commit 3451116
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions pypiret/Runs/Summ.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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']:
Expand All @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions tests/test_pipeline_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 3451116

Please sign in to comment.