Question: Create a single fastq ids in each row
0
gravatar for harry
21 days ago by
harry10
harry10 wrote:

See below are some fastq ids:

A00868:56:HK2YWDRXX:1:2103:1832:17472,A00868:56:HK2YWDRXX:1:2106:21775:8547,A00868:56:HK2YWDRXX:1:2113:26883:13761,A00868:56:HK2YWDRXX:1:2120:23276:14278,A00868:56:HK2YWDRXX:1:2126:27091:5196,A00868:56:HK2YWDRXX:1:2131:23583:12493,A00868:56:HK2YWDRXX:1:2136:1787:17769,A00868:56:HK2YWDRXX:1:2171:1515:29606,A00868:56:HK2YWDRXX:1:2172:17020:32127,A00868:56:HK2YWDRXX:1:2174:4969:10848,A00868:56:HK2YWDRXX:1:2175:1777:25363,A00868:56:HK2YWDRXX:1:2211:18719:5635,A00868:56:HK2YWDRXX:1:2212:25780:9784,A00868:56:HK2YWDRXX:1:2212:24144:36511,A00868:56:HK2YWDRXX:1:2265:4137:11318,A00868:56:HK2YWDRXX:1:2270:15745:24345,A00868:56:HK2YWDRXX:1:2271:20663:36057,A00868:56:HK2YWDRXX:2:2103:22941:4085,A00868:56:HK2YWDRXX:2:2104:25400:18176,A00868:56:HK2YWDRXX:2:2117:16260:17597,A00868:56:HK2YWDRXX:2:2134:11912:1297,A00868:56:HK2YWDRXX:2:2173:17924:12399,A00868:56:HK2YWDRXX:2:2214:13566:19288,A00868:56:HK2YWDRXX:2:2215:8088:29778,A00868:56:HK2YWDRXX:2:2231:22001:24220,A00868:56:HK2YWDRXX:2:2240:7057:12962,A00868:56:HK2YWDRXX:2:2247:4291:31187,A00868:56:HK2YWDRXX:2:2275:18629:30217,A00868:56:HK2YWDRXX:1:2116:24053:5697,A00868:56:HK2YWDRXX:1:2136:16911:23109,A00868:56:HK2YWDRXX:2:2101:15492:33051,A00868:56:HK2YWDRXX:2:2134:21549:9126,A00868:56:HK2YWDRXX:2:2178:32560:27821,A00868:56:HK2YWDRXX:2:2216:2329:23688,A00868:56:HK2YWDRXX:2:2238:15772:11616,A00868:56:HK2YWDRXX:2:2242:14199:14810,A00868:56:HK2YWDRXX:2:2258:18249:20854,A00868:56:HK2YWDRXX:2:2265:8901:23516
A00868:56:HK2YWDRXX:1:2160:31476:14826,A00868:56:HK2YWDRXX:1:2257:30581:6104,A00868:56:HK2YWDRXX:2:2108:4300:34366,A00868:56:HK2YWDRXX:2:2141:4182:19476,A00868:56:HK2YWDRXX:2:2146:23041:20541,A00868:56:HK2YWDRXX:2:2118:4209:25942,A00868:56:HK2YWDRXX:2:2142:22679:20134,A00868:56:HK2YWDRXX:2:2150:16306:7905,A00868:56:HK2YWDRXX:2:2244:31620:15984
A00868:56:HK2YWDRXX:1:2125:5927:25629,A00868:56:HK2YWDRXX:1:2215:16649:30796
A00868:56:HK2YWDRXX:1:2139:3568:19006,A00868:56:HK2YWDRXX:1:2233:19108:31015,A00868:56:HK2YWDRXX:1:2244:25654:8281,A00868:56:HK2YWDRXX:2:2234:26684:24251,A00868:56:HK2YWDRXX:1:2276:24415:33348

In each row, there are multiple fastq ids and I want in each row a single id like below:

A00868:56:HK2YWDRXX:1:2103:1832:17472
A00868:56:HK2YWDRXX:1:2106:21775:8547
A00868:56:HK2YWDRXX:1:2113:26883:13761
A00868:56:HK2YWDRXX:1:2120:23276:14278
A00868:56:HK2YWDRXX:1:2125:5927:25629

So please tell me there is any command to create a single id in each row. Thanks in advance

extract fastq_ids • 86 views
ADD COMMENTlink modified 21 days ago by Istvan Albert ♦♦ 86k • written 21 days ago by harry10
1
gravatar for Istvan Albert
21 days ago by
Istvan Albert ♦♦ 86k
University Park, USA
Istvan Albert ♦♦ 86k wrote:

assuming your input is in a file called ids you can use the UNIX command line tool called tr to transform commas into newlines like so:

cat ids | tr ',' '\n' | head

prints:

A00868:56:HK2YWDRXX:1:2103:1832:17472
A00868:56:HK2YWDRXX:1:2106:21775:8547
A00868:56:HK2YWDRXX:1:2113:26883:13761
A00868:56:HK2YWDRXX:1:2120:23276:14278
A00868:56:HK2YWDRXX:1:2126:27091:5196
A00868:56:HK2YWDRXX:1:2131:23583:12493
A00868:56:HK2YWDRXX:1:2136:1787:17769
A00868:56:HK2YWDRXX:1:2171:1515:29606
A00868:56:HK2YWDRXX:1:2172:17020:32127
A00868:56:HK2YWDRXX:1:2174:4969:10848
ADD COMMENTlink modified 21 days ago • written 21 days ago by Istvan Albert ♦♦ 86k

You might want to do a sort and uniq to make sure there are no duplicates.

ADD REPLYlink written 20 days ago by swbarnes29.4k

Thanks, Istvan Albert. It working very well.

ADD REPLYlink written 18 days ago by harry10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2537 users visited in the last hour
_