什麼是:label;N
在下文提到的命令什麼的解釋:標籤; N下面提到線
sed -i ':label;N;s/\+.*\n.*\n//;b label' paired.fa
piared.fa
看起來像這樣
@HWI-ST963:188:C29Y5ACXX:4:1107:1493:57038/1:@HWI-ST963:188:C29Y5ACXX:4:2307:16619:181383/2
GAGCCCCGCTTCATCGCCGTGGGCTACGTGGACGACACGCAGTTCGTGCGGTTCGACAGCGACGCCGCGAGCCAGAAGATGGAGCCGCGGGCGCCGTGGAT:TCCATGAGGTATTTCTTCACATCCGTGTCCCGGCCCGGCCGCGGGGAGCCCCGCTTCATCGCCGTGGGCTACGTGGACGACACGCAGTTCGTGCGGTTCGA
+:+
@CCFFFFFHHHGHIIFIIJGHGGGHIIJFGGGG0AH>[email protected]?B?BABDDDDDDBBDBBDBDDDCBBDCDCCCCDDDDDDBBBBDBB5<[email protected]:@@[email protected]DDDCDDDDDDDDDBD>BBDDDDDDDBDDDD5<[email protected]
@HWI-ST963:188:C29Y5ACXX:4:2307:16619:181383/1:@HWI-ST963:188:C29Y5ACXX:4:2307:7539:10902/2
CCCTCCTGCTCTATCCACGGCGCCCGCGGCTCCATCTTCTGGCTCGCGGCGTCGCTGTCGAACCGCACGAACTGCGTGTCGTCCACGTAGCCCACGGCGAT:GAGCCCCGCTTCATCGCCGTGGGCTACGTGGACGACACGCAGTTCGTGCGGTTCGACAGCGACGCCGCGAGCCAGAAGATGGAGCCGCGGGCGCCGTGGAT
+:+
CCCFFFFFHHHHHJJIJIJJJJJJJJJJIJJJHGHHHHFFFFFCE?BBB<<07<@[email protected]@[email protected];BDBDDACD95<[email protected]@@9:CCCFFFFFHHHGHJJJJJJIJJJJJJJJJJJIJJJJIJHHFFFEEDCDDDB?BDDDDDDDDDDDBDDDDDDDDDDDDDCDDDDDDDDDDDDDDDDD<[email protected]
@HWI-ST963:188:C29Y5ACXX:4:2307:7539:10902/1:@HWI-ST963:188:C29Y5ACXX:4:1107:1493:57038/2
GCCTTCATATTCCGTGTCTCCTGGTCCCAATACTCCGGCCCCTCCTGCTCTATCCACGGCGCCCGCGGCTCCATCTTCTGGCTCGCGGCGTCGCTGTCGAA:GCCTTCATATTCCGTGTCTCCTGGTCCCAATACTCCGGCCCCTCCTGCTCTATCCACGGCGCCCGCGGCTCCATCTTCTGGCTCGCGGCGTCGCTGTCGAA
+:+
CCCFFFFFHHHHHIHHHIJJJI[email protected]>[email protected]@[email protected]><A8<@:@CCF[email protected]DDDDDCDDCDDCDDDD799>B95<9<>.5:([email protected]
我懷疑這是錯誤的代碼。我相信的目的是刪除包含「+」和下面一行的行。但是這並沒有考慮到文件結束的情況。另一個解決方案是'sed -i'/ +/{N; d}'文件',或者如果邊緣情況不是錯誤'sed -i'/ +/{N; $!d}'文件' – potong