So I have a file, let's call it pcawg.tsv. It's formatted like the one down below.
Tumor sample ID Normal sample ID Mechanism
a 1 deletion
b 2 ecDNA
c 3 ecDNA
I have a file of tumor sample ID's with the ecDNA mechanism called ecDNA_samples.tsv. It's formatted like this:
Tumor sample ID
a
b
To filter and extract the lines of pcawg.tsv
that contain the tumor sample ID's in ecDNA_samples.tsv
into a new file, I used this line of code below.
grep -f ecDNA_samples.tsv pcawg.tsv > ecDNA.vcf.tsv
Would this be the right code to use?
grep
to do this? It would be possible to make a more robust solution using R. $\endgroup$