SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Updated How to convert .txt file to .bed .GFF or .BAR file format, forevermark4 Bioinformatics 2 06-30-2014 05:02 AM
Is there a BED file format validator? Does a BED file have to be sorted position? LauraSmith Bioinformatics 3 05-21-2013 11:54 AM
convert vcf into bed format nans_bn Bioinformatics 0 08-01-2011 11:34 PM
How to convert BED format to SAM/BAM? seq_newbie Bioinformatics 1 06-23-2011 08:11 AM
Help convert maq map format to eland format hard998 Bioinformatics 0 07-20-2009 07:37 PM

Reply
 
Thread Tools
Old 01-19-2011, 10:35 AM   #1
huo
Junior Member
 
Location: PA

Join Date: Jan 2011
Posts: 3
Default How to convert eland file to BED format

I have file in the following format. I want to use MACS but it requires bed format how can I convert my file to bed format

HWUSI-EAS230-R 1 2 4 713 1086 0 1 ACAAGTTACATAACCTCCCTGATATTATGAACCCAA aaabaaab`baaa``aa_`aa`aaaaaaaaa\^_`a c3.fa 188833058 R 36 118

Thanks,
huo is offline   Reply With Quote
Old 01-19-2011, 10:43 AM   #2
selen
Junior Member
 
Location: Ohio

Join Date: Dec 2010
Posts: 9
Default

The following awk script converts sorted file to BED format that has 4 fields. You can update the script as you need...

# sortedToBed.awk
# Input : SORTED FILE
# Output : <Chromosome> <start position> <stop position> <strand>
# Usage
# awk -f sortedToBed.awk SORTED_INPUT_FILE_NAME > BED_OUTPUT_FILE_NAME

{OFS=" ";

len=length($9);

split($11, ref_chr, ".");

if ($13=="F") strand = "+";
else if($13=="R") strand = "-";
else strand = "None";

if (strand!="None")
print ref_chr[1], $12, $12+len, strand ;
}


Good Luck!
Selen
selen is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 06:29 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO