具體報錯信息如下:
[root@localhost pool-5.2]# /home/packages/stacks-2.54/process_radtags -P -p ./raw/ -b ./pool-5.2.txt -o ./samples/ -c -q -r --inline_index --renz_1 mluCI --renz_2 avaII
Processing paired-end data.
Using Phred+33 encoding for quality scores.
Found 1 paired input file(s).
Searching for single-end, inlined and paired-end, indexed barcodes.
' (filenames can consist of letters, numbers, '.', '-' and '_').
這個錯誤在網上找不到任何線索,只能通過閱讀源碼來解決:
首先定位到stacks的安裝目錄
我的目錄如下:
[root@localhost pool-5.2]# cd /home/packages/stacks-2.54/
[root@localhost stacks-2.54]# ls
acinclude.m4 ChangeLog config.h config.status cstacks INSTALL libcore.a Makefile phasedstacks process_shortreads src tests
aclocal.m4 clone_filter config.h.in configure gstacks kmer_filter libpop.a Makefile.am populations README sstacks tsv2bam
autogen.sh config config.log configure.ac htslib libclean.a LICENSE Makefile.in process_radtags scripts stamp-h1 ustacks
[root@localhost stacks-2.54]#
進入src文件夾章郁,這個是stacks的源碼所在位置
然后搜索錯誤信息:' (filenames can consist of letters, numbers, '.', '-' and '_').
[root@localhost stacks-2.54]# cd src
[root@localhost src]# grep -r "' (filenames can consist of letters, numbers, '.', '-' and '_')." .
./file_io.cc: cerr << "Invalid filename on line " << line_num << ": '" << s << "' (filenames can consist of letters, numbers, '.', '-' and '_').\n";
Binary file ./file_io.o matches
[root@localhost src]#
注意符號不能寫錯轮洋,用雙引號""將出錯信息擴起來制市,最后一個點代表在當前目錄搜索所有文件,看看哪個文件包含錯誤信息
可以看到與該錯誤信息相關的文件名是file_io.cc
那我們開始查看這段代碼:
//
// Check for the existence of a file name to associate with this barcode set.
//
if (q - p < id_len)
q++;
s = q;
while (*q != '\0') {
if (!isalnum(*q)) {
switch (*q) {
case '-':
case '_':
case '.':
break;
case '\r':
case '\t':
*q = '\0';
break;
default:
cerr << "Invalid filename on line " << line_num << ": '" << s << "' (filenames can consist of letters, numbers, '.', '-' and '_').\n";
exit(1);
}
}
if (*q != '\0') q++;
}
barcodes.push_back(BarcodePair(p, r, s));
if (p != NULL && strlen(p) > 0) se_bc.insert(string(p));
if (r != NULL && strlen(r) > 0) pe_bc.insert(string(r));
}
fh.close();
這段代碼的注釋是:// Check for the existence of a file name to associate with this barcode set.
說明這段代碼的功能是處理文件名和barcodes的關系弊予,那么我們容易就想到祥楣,是不是barcodes文件的命名有問題
檢查barcodes文件的所有字符,與正常的barcodes文件作為對比
[root@localhost pool-5.2]# cat -A pool-5.2.txt /有問題的barcode文件
GTCGA^IGGCTAC^IKE4^M$
TACCG^IGGCTAC^IKE5^M$
TACGT^IGGCTAC^IKE6^M$
TAGTA^IGGCTAC^IKE7^M$
TATAC^IGGCTAC^IKE8^M$
TCACG^IGGCTAC^IKE9^M$
TCAGT^IGGCTAC^IKE10^M$
TCCGG^IGGCTAC^IKE11^M$
TCTGC^IGGCTAC^IKE12^M$
TGGAA^IGGCTAC^IKE13^M$
TTACC^IGGCTAC^IJM1 ^M$
[root@localhost pool-5.2]# cat -A pool-5.2.txt /正常的barcode文件
TACCG^ITGACCA^IHJ2-13^M$
TACGT^ITGACCA^IHJ2-14^M$
TAGTA^ITGACCA^IHJ2-15^M$
TATAC^ITGACCA^IHJ2-16^M$
TCACG^ITGACCA^IXY1^M$
TCAGT^ITGACCA^IXY2^M$
TCCGG^ITGACCA^IXY3^M$
TCTGC^ITGACCA^IXY4^M$
TGGAA^ITGACCA^IXY5^M$
TTACC^ITGACCA^IXY6^M$
我們發(fā)現(xiàn)出問題barcods文件最后一行多了一個空格字符汉柒,如果直接打開是不容易看出來的误褪,因此要使用 cat -A 把所有字符顯示出來
檢查到問題所在,我們對有問題的barcodes文件的空格刪掉
[root@localhost pool-5.2]# sed -i "s/ //g" pool-5.2.txt
[root@localhost pool-5.2]# cat -A pool-5.2.txt
GGATA^IGGCTAC^IKD8^M$
GGCCA^IGGCTAC^IKD9^M$
GGCTC^IGGCTAC^IKE1^M$
GTAGT^IGGCTAC^IKE2^M$
GTCCG^IGGCTAC^IKE3^M$
GTCGA^IGGCTAC^IKE4^M$
TACCG^IGGCTAC^IKE5^M$
TACGT^IGGCTAC^IKE6^M$
TAGTA^IGGCTAC^IKE7^M$
TATAC^IGGCTAC^IKE8^M$
TCACG^IGGCTAC^IKE9^M$
TCAGT^IGGCTAC^IKE10^M$
TCCGG^IGGCTAC^IKE11^M$
TCTGC^IGGCTAC^IKE12^M$
TGGAA^IGGCTAC^IKE13^M$
TTACC^IGGCTAC^IJM1^M$
可以看到空格已經被刪掉了
最后我們再來運行一下
[root@localhost pool-5.2]# /home/packages/stacks-2.54/process_radtags -P -p ./raw/ -b ./pool-5.2.txt -o ./samples/ -c -q -r --inline_index --renz_1 mluCI --renz_2 avaII
Processing paired-end data.
Using Phred+33 encoding for quality scores.
Found 1 paired input file(s).
Searching for single-end, inlined and paired-end, indexed barcodes.
Loaded 48 barcodes (5bp / 6bp).
Will attempt to recover barcodes with at most 1 / 1 mismatches.
Processing file 1 of 1 [52_R1_001.fastq.gz]
Reading data from:
./raw/52_R1_001.fastq.gz and
./raw/52_R2_001.fastq.gz
Processing RAD-Tags...
好了碾褂,沒有' (filenames can consist of letters, numbers, '.', '-' and '_').
問題解決兽间!