Question: How to sort chromosome name in bed file
0
gravatar for raya.girish
4.2 years ago by
raya.girish20
raya.girish20 wrote:

Hello Friends!! I have one stupid question i have bed file

chr1 955541 955763 AGRN.chr1.955552.955753
chr1 957569 957852 AGRN.chr1.957580.95784

in my bed file my chromosome name are not sorted i want output in

chr1 chr2 ..... chr22 chrX chrY chrM

can anyone help me out

thanks!!!!!!

sort chrmosome bedfile • 2.1k views
ADD COMMENTlink modified 4.2 years ago by genomax89k • written 4.2 years ago by raya.girish20
1

use the sortBed

ADD REPLYlink written 4.2 years ago by Prasad1.6k

can you tell me how should i sort using sortbed i mean commands

ADD REPLYlink written 4.2 years ago by raya.girish20

i used bedtool/sort -chrThenSizeA -i my.bed > new.bed

it not working

ADD REPLYlink written 4.2 years ago by raya.girish20

Please see the answer below and provide feedback.

If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. Upvote|Bookmark|Accept

ADD REPLYlink written 2.7 years ago by RamRS30k
3
gravatar for Prasad
4.2 years ago by
Prasad1.6k
India
Prasad1.6k wrote:
sortBed -i inputfile >outfile

By default it sorts by chromosome and then by start position in ascending order. It has many other options, kindly go through the manual

ADD COMMENTlink modified 4.2 years ago by genomax89k • written 4.2 years ago by Prasad1.6k
1

@Prasad - It would be better if you change it answer from comment and format the code, so that OP can accept the answer and the question will not remain as unanswered, and also helpful for future googlers.

ADD REPLYlink written 4.2 years ago by venu6.7k
2

@Venu - Sure i will keep that in mind. @genomax - thanks for the format

ADD REPLYlink written 4.2 years ago by Prasad1.6k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1570 users visited in the last hour