Skip to content

albertwcheng/bedSeq

Repository files navigation

bedSeq

=== USAGE ====

Usage: ./bedSeq <seqDir> <bedfilename> <bedfiletype:bed|ebed> [options] > <ofilename>
Description: 	append sequence to bed files (bed format for the feature coordinate, ebed format for feature block coordinates)
		seqDir contains per chromosome <chr>.seq which is one line raw sequence without header. convert fa to seq file using convertFaToPureSeq.py
Options:
--output-fasta	output fasta file instead of appending seq to bed file
--use-coord-as-name	use coordinate as name of sequence instead of the name field of bed file. Only valid when --output-fasta option is specified
--use-block-coord-as-name	use block coordinate as name. Only when --output-fasta is specified and format is ebed

=== INSTALLATION ===

compile using 

bash make.sh

install into path by changing, e.g., ~/.bashrc

export PATH=${PATH}:/path/to/bedSeq/folder

=== TIPS for making seq files from fasta files (one fasta per chromosome) ===

Say you have <chr>.fa for each chromosome, e.g., chr1.fa 

You can use the convertFaToPureSeq.py python script to do conversion. If it is in your path, then

for i in *.fa; do convertFaToPureSeq.py $i ${i/.fa/}.seq; done

this will make <chr>.seq for each chromosome. e.g., chr1.fa => chr1.seq

=== EXAMPLES ===

example file is top 10 lines from mm9 acembly (http://www.ncbi.nlm.nih.gov/IEB/Research/Acembly/) bed file downlaoded from UCSC genome browser table -> mouse genome mm9 -> gene prediction track -> AceView -> acembly -> format bed
and renamed as acembly.ebed, then 

head acembly.ebed > acembly.top10.ebed 

---

to append sequences to the end of the bed file (assuming that you installed the seq files in the seq/ subfolder:
bedSeq seq/ acembly.top10.ebed ebed > acembly.top10.ebedseq

to get fasta files of the sequences:
bedSeq seq/ acembly.top10.ebed ebed --output-fasta > acembly.top10.fasta

About

A program to efficiently append sequences to bed files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published