具体报错信息如下:
[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$
我们发现出问题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 '_').
问题解决!