Fastx Barcode Splitter
1
0
Entering edit mode
11.2 years ago
freddy ▴ 40

I am trying to use fastX barcode splitter perl script on my fastq file. However, every time I run the program I get this message Error: barcode file not specified (use '--bcfile [FILENAME]'). All I am doing is dragging the perl script into terminal, and dragging the fastq file into the terminal and hit enter and that what I get. I also read I had to make mybarcode text file which is BC1 and then tab space then the barcode where does that go. Any help would be appreciated

fastx fastq barcode • 8.4k views
ADD COMMENT
2
Entering edit mode
11.2 years ago
JacobS ▴ 990

You need to use the actual UNIX command structure instead of dragging and dropping, and you need to provide the barcode text file.

Make a barcode text file just as you specified, either in textedit (sounds like you are on a Mac) or within the terminal, using something like vi or nano. If you want to make a text file like this using vi, follow these direction exactly:

vi my_barcode.txt

This opens the built-in text editor

To type, you need to switch to "insert mode" by pressing the i key

Type the following, as you specified:

BC1 ATCGTT

(BC1 is the name you are giving the barcode followed by the barcode ID, separated by a tab)

To save and close the document, press esc to exit "insert mode", and type :wq to write the file and quit

Now you will have the barcode file you need! So then run your command like this:

cat my_raw_read_file.fastq | fastx_barcode_splitter.pl --bcfile my_barcode.txt

Please keep in mind there are many parameters that you may want to use, so please thoroughly check out the explanation and usage examples found in the documentation.

ADD COMMENT
0
Entering edit mode

Do I have to be in a particular directory

ADD REPLY
0
Entering edit mode

Hi JacobS

I also have similar question. I have 56 sample and barcodes. How should I make a barcode file, should I make a file for individual barcode or I can make a single file for 56 sample using tab delimited text format. I made a single barcode file with 56 barcode and try to split the original FASTQ file into 56 small FASTQ file based on barcode but everytime I am getting only one file with first barcode and all the reads match with first barcode. Could you please suggest me is there any away to split it into 56 file.

Thanks

ADD REPLY
0
Entering edit mode
cat adapters.txt |
while read ADAPTER; do
    cutadapt \
        -g $ADAPTER \
        --trimmed-only \
        -o reads.${ADAPTER}.fastq \
        AllAdapters.fastq |
        tee results.${ADAPTER}.log
done

If I got you right, you're trying to loop through go through many adapters and extract reads with specific adapter. If so, try the code above (should work). You have to have your adapter sequences in adapters.txt file and fastq reads in AllAdapters.fastq. Also you might need to use (-a instead of -g)

adapters.txt example:

AAAAAATTTAAAAAA
CCCCCCGGGCCCCC
CCCAAATTTTGGGG
ACGTACGTACGTACGT

PS.: If you prefer GNU parallel to old fashioned loop, check out Pierre's tutorial.

ADD REPLY
0
Entering edit mode

Thank you, it is also helpful for me.

ADD REPLY

Login before adding your answer.

Traffic: 993 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6