Admixtools ancIBD github

One way of extracting a sample IBD and chrs matches (similar to Post #15 zip download.

Open the ibd and the ch_all files and copy exactly the sample name.
With grep:
open a command prompt:
grep -w "sample_name" "AncIBDfile.tsv" > ibd_sample.tsv
and/or:
grep -w "sample_name" "ch_all_Anc_Ita.tsv" > ch_sample.tsv
(keep the quotes in the command).

It should extract all lines containing sample_name.

To append the Header:
do copy and paste, or create a new text file, add the ibd header below, and save it as: ibd_header.txt
Code:
iid1    iid2    max_IBD    sum_IBD>8.0    n_IBD>8.0    sum_IBD>12.0    n_IBD>12.0    sum_IBD>16.0    n_IBD>16.0    sum_IBD>20.0    n_IBD>20.0

... and the ch_all Header below and save it as: ch_all_header.txt
Code:
Start    End    StartM    EndM    length    lengthM    ch    iid1    iid2

cat ibd_header.txt ibd_sample.tsv >> ibd-sample.tsv
and:
cat ch_all_header.txt ch_sample.tsv >> ch-sample.tsv

We could also merge the sample ibd and ch files:
cat ibd-sample.tsv ch-sample.tsv >> ibd-ch-sample.tsv
 
Last edited:
f1R (Pompeii) extraction:
In Windows, ... I'll use grep.exe and cat.exe part of WGSExtract2.

ibd
D:\WGSExtract2\programs\samtools-cygwin\grep.exe -w "f1R_Pompeii_Roman" "Anc_ibd_Ita.tsv" > ibd-f1R_Pompeii.tsv
D:\WGSExtract2\programs\samtools-cygwin\cat.exe ibd_header.txt ibd-f1R_Pompeii.tsv >> ibd_f1R_Pompeii.tsv

ch
D:\WGSExtract2\programs\samtools-cygwin\grep.exe -w "f1R_Pompeii_Roman" "ch_all_Anc_Ita.tsv" > ch-f1R_Pompeii.tsv
D:\WGSExtract2\programs\samtools-cygwin\cat.exe ch_all_header.txt ch-f1R_Pompeii.tsv >> ch_f1R_Pompeii.tsv

ibd ch merge ... optional, but it also defeat the Excel limitation of not opening 2 files with the same name, ... though I could have renamed them :)

D:\WGSExtract2\programs\samtools-cygwin\cat.exe ibd_f1R_Pompeii.tsv ch_f1R_Pompeii.tsv >> ibd_ch_f1R_Pompeii.tsv

... the output:
iid1iid2max_IBDsum_IBD>8.0n_IBD>8.0sum_IBD>12.0n_IBD>12.0sum_IBD>16.0n_IBD>16.0sum_IBD>20.0n_IBD>20.0
f1R_Pompeii_RomanTAQ007_Etruscan
8.507699​
8.507699​
1​
0​
0​
0​
0​
0​
0​
StartEndStartMEndMlengthlengthMchiid1iid2
13132​
15278​
0.592117​
0.677194​
2146​
0.085077​
1​
f1R_Pompeii_RomanTAQ007_Etruscan
1507​
2914​
0.049938​
0.112881​
1407​
0.062943​
3​
f1R_Pompeii_RomanR1_Proto-Villanovan
5841​
7853​
0.235944​
0.297853​
2012​
0.061909​
6​
f1R_Pompeii_RomanR1016_IA
57372​
59523​
1.347888​
1.411825​
2151​
0.063937​
6​
R11119_Roman_Imperialf1R_Pompeii_Roman
45959​
47324​
1.385171​
1.446945​
1365​
0.061774​
9​
f1R_Pompeii_RomanI16170_Sardinia_MBA
20609​
22130​
0.69623​
0.764228​
1521​
0.067998​
10​
f1R_Pompeii_RomanVK536_Medieval
51241​
52674​
1.445873​
1.507216​
1433​
0.061343​
11​
f1R_Pompeii_RomanPRZ001_Etruscan
5088​
6667​
0.237875​
0.30684​
1579​
0.068965​
12​
f1R_Pompeii_RomanC4-R1550_Imperial
42449​
44941​
1.273792​
1.345665​
2492​
0.071873​
12​
f1R_Pompeii_RomanR11109_Roman_Imperial
4764​
6095​
0.271265​
0.331541​
1331​
0.060276​
17​
f1R_Pompeii_RomanUZZ061_Sicily_MN
 
Last edited:

This thread has been viewed 1962 times.

Back
Top