Skip to content
Snippets Groups Projects
Commit 48eb1096 authored by Brent Pedersen's avatar Brent Pedersen
Browse files

change -exons to -split. add tests that make sense.

parent f7933016
No related branches found
No related tags found
No related merge requests found
......@@ -88,7 +88,7 @@ int fastafrombed_main(int argc, char* argv[]) {
else if(PARAMETER_CHECK("-name", 5, parameterLength)) {
useNameOnly = true;
}
else if(PARAMETER_CHECK("-exons", 6, parameterLength)) {
else if(PARAMETER_CHECK("-split", 6, parameterLength)) {
useExons = true;
}
else if(PARAMETER_CHECK("-tab", 4, parameterLength)) {
......@@ -131,7 +131,7 @@ void fastafrombed_help(void) {
cerr << "\t-bed\tBED/GFF/VCF file of ranges to extract from -fi" << endl;
cerr << "\t-fo\tOutput file (can be FASTA or TAB-delimited)" << endl;
cerr << "\t-name\tUse the name field for the FASTA header" << endl;
cerr << "\t-exons\tgiven a bed12, concat the sequence from exons" << endl;
cerr << "\t-split\tgiven a bed12, concat the sequence from exons" << endl;
cerr << "\t-tab\tWrite output in TAB delimited format." << endl;
cerr << "\t\t- Default is FASTA format." << endl << endl;
......
chr1 0 40 three_blocks_match 0 + 0 0 0 3 2,10,10, 5,16,36,
chr1 0 40 three_blocks_match 0 + 0 0 0 3 1,1,1, 10,20,30,
>chr1
aaaaaaaaaa
cccccccccc
tttttttttt
gggggggggg
aaaaaaaaaa
aggggggggg
cggggggggg
tggggggggg
aggggggggg
cggggggggg
echo $'chr1\t1\t10' | ./bin/bedtools getfasta -fi test/fastaFromBed/t.fa -bed stdin -fo t.txt
echo $'chr1\t1\t10' | ../../bin/bedtools getfasta -fi t.fa -bed stdin -fo stdout > /dev/null
LEN=$(../../bin/bedtools getfasta -split -fi t.fa -bed blocks.bed -fo stdout | awk '(NR == 2){ print length($0) }')
if [ "$LEN" != "22" ]; then
print "BAD";
fi
SEQ=$(../../bin/bedtools getfasta -split -fi t.fa -bed blocks.bed -fo stdout | awk '(NR == 4){ print $0 }')
if [ "$SEQ" != "cta" ]; then
print "BAD";
fi
./bin/bedtools getfasta -exons -fi test/fastaFromBed/t.fa -bed test/fastaFromBed/blocks.bed -fo stdout
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment