python importing featureCounts to automate multiple files
1
0
Entering edit mode
4 months ago
maxdlf12 • 0

Hello I'm trying to use featureCounts for multiple files using python script

but python doesn't seem to be able to load featureCounts feature.

My python script is as below.


import os  
import sys 
number=['ss','sss',ssss','ssss'] 
for a in number: 
     os.system("featureCounts -a /home/biguser/systems_biology_2021/TA/gtf/gencode.v34.gtf -p -o /home/biguser/xxxxxxxxxxxx/xxxxxxxxxxx/organizedF/feaC/%s/%s_feaCon.txt /home/biguser/xxxxxxx/xxxxxxxx/organizedF/mappedControl/%s/%s_Aligned.sortedByCoord.out.bam -T 4"%(a,a,a,a))

And the result.


[biguser@xxxx-master finalP]$ python pyfeaCon.py 

sh: featureCounts: command not found 
sh: featureCounts: command not found 
sh: featureCounts: command not found 
sh: featureCounts: command not found

I'm pretty new to these stuff, so I was wondering if i could get any help

Thanks.

P.S How do I create a new line in this thing? Even if I 'enter' it just stays in a paragraph.

featureCounts python • 465 views
ADD COMMENT
1
Entering edit mode

How do I create a new line in this thing? Even if I 'enter' it just stays in a paragraph.

Markdown formatting rules are that 2 new line characters move to a new paragraph in the rendered markdown (like an HTML <br> tag) while one new line just moves the cursor in the raw markdown text (again, like in HTML).

ADD REPLY
0
Entering edit mode

Thanks! I guess I didn't know much about web formats.

ADD REPLY
3
Entering edit mode
4 months ago
Ram 34k

Ideally, you should use something like snakemake, not a raw python script. In any case, try providing the full path to featureCounts in your system().

ADD COMMENT
0
Entering edit mode

wow thanks! it solve the problem

ADD REPLY
0
Entering edit mode

Glad it helped! A small educational note: if an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one answer if they work. This will help future users that might find this post find the right answer.

upvote_bookmark_accept

ADD REPLY
0
Entering edit mode

Oh Cool. Done!

ADD REPLY

Login before adding your answer.

Traffic: 2638 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6