Entering edit mode
8.7 years ago
aj123
▴
120
Hello,
Im trying to write a script (pref in Perl) to find the genes that closest to the top ten peaks in a MACS chip-seq output. anyhelp would be appreciated. if someone could tell me how to call Bedtools in Perl to do this that would also work. I have a lot of data and hence want to script it for automation. thanks!
"I'm trying to write a scrip", you can post here what have you tried, so that people can make corrections.
I think the question is not very clear possibly the OP needs to give a scenario to make it more clear and a snippet to say where it is at fault. What is meant by " to find the genes that closest to the top ten peaks in a MACS chip-seq output "? Preferably it should be the top peaks that is called by MACS and then associate the closest gene feature right. In that case
bedops
an option to do. Take a look at the link here posted by Alex Reynolds if you are not restricted to only bedtools, in anycase for perl you can use bioperl and import the required*.pm
and call it for usage within your perl script (provided) your path is properly set.There are loads of programs to do that, unless the OP wants to do it from scratch as a way to learn programming etc.
True but the OP needs to give the input and output scenario with the faulty code else it is useless to go forward. In any case I gave a straight forward approach if its for work purpose nonetheless it is not for learning programming from scratch.
I'm just spouting out what has already been iterated here in the comments. First, we need to have some criteria or rationale for what you consider the top ten peaks in MACS output. P value? Fold change? How do we decide on the top 10 peaks?
After that is taken care of, bedtools can do this with the
closest
function using the-k
option so unless you are trying to incorporate it into a workflow / pipeline, I don't even think Perl is necessary.Lastly, also include your code here if you can help it. The members that can and will help you are those that want to ensure you've put effort into a question before they help you answer it.