[R] How to loop over two files ...
@okov|c@@n@m@r|j@ @end|ng |rom gm@||@com
Fri Jun 19 21:34:17 CEST 2020
I have two files (each has 300 lines)like this:
For each pair of rs# from those two files I can run this command in R
server <- "http://rest.ensembl.org"
ext <- "/ld/human/pairwise/rs6792369/rs1042779?population_name=1000GENOMES:phase_3:KHV"
r <- GET(paste(server, ext, sep = ""), content_type("application/json"))
d_prime r2 variation1 variation2 population_name
1 0.975513 0.951626 rs6792369 rs1042779 1000GENOMES:phase_3:KHV
What I would like to do is to do is to run this command for every SNP
in one list (1g.txt) to each SNP in another list (1n.txt). Where SNP#
is rs# and output every line of result in list.txt
The process is illustrated in the attachment.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 27519 bytes
Desc: not available
More information about the R-help