I used:
seqkit locate -i -d -p AUGGACUN
looks good.
one last question? do you know an easy way to extract 50 bp around peak centre from .fa or .bed file?
thanks
Dear All,
I have ChIP-seq peaks for a given transcription factor in a Bed format and I would like to split this bed file based on the consensus of the TF binding into two bed files ,, is there any tools or script that can do this job.
many many thanks TA
What you need is probably FIMO from the MEME suite. It is able to match a motif to given sequences in fasta format, returning significant matches. It will return results in GFF3 format so you can use bedtools intersect with and without its -v option to separate your BED file into overlaps with the signicicant matches and those without. See FIMO documentation.
I used:
seqkit locate -i -d -p AUGGACUN
looks good.
one last question? do you know an easy way to extract 50 bp around peak centre from .fa or .bed file?
thanks
If you mean with center the exact middle of an interval you can use bedtools slop like:
cat test.bed
chr1 100 200
bedtools slop -pct -l -0.5 -r -0.5 -g chromSizes.txt -i test.bed | bedtools slop -b 25 -g chromSizes.txt
chr1 125 176
and then use bedtools getfasta to make a fasta out of it.
in Bedtools documentation:
bedtools slop will increase the size of each feature in a feature file by a user-defined number of bases.
What is the question?
i need to shorten the grange
That is what the code is doing. The first command resizes the interval to the center position and the second one then extends the center to 25bp each direction, giving a 50bp window around the center.
many many thanks for your help
Sure thing. Feel free to add a comment if there are any problems.
another question :) if i would like to get 100 bp around the max height of the peak what would be the correct way?
If you called peaks with macs2 then it should have the peak summit position in column 10 of the narrowPeak file. So you would add value of column10 to the start coordinate to get the actual peak center with the highest coverage. From there you can again use the code snipped above. If you used other peak callers they might not have this column, so either go with a custom solution to get the actual summit or simply take the peak center (I use peak center since everything else is too tideous and in my experience it does not make too much of a difference, but I never properly benchmarked this).
Log in to answer this question.
Please give a representative output. It is not fully clear (at least to me) what you want to do.
I have a bed file with 20K peaks not all of them have the consensus of my TF of interest .. the question is I wanna filter that bed file into two bed files based on the consensus sequence. All.bed:
based on the consensus motif of my TF (
NGATAN) i would like to have two bed files:with_consensus.bed
without_consensus.bed