I'd like to download a vcf and then import some of the columns into google sheets. Any ideas on how to approach this? Thank you.
The first thing you need is an app that can open and read a VCF file. Do you have such an app? I don’t.
If you have an app, and it allows you to select a column of text in that file, then you should be able to copy and paste it into a Google spreadsheet.
Echoing @Airy -- what do you have available that might make this easier? There's a homebrew formula for vcftools
, for example.
If you just want to process raw text you should be able to:
- Download the file
- Use the "Read a file" action to get it into a variable
- Find the first line that starts with a single
#
- Extract column headers from that line
- Work out the column numbers for the columns you want -- the data is tab-separated, so easy enough to do
- Use those numbers to extract the columns you want, saving to disk (or variable) as tab-separated
- Import the file (or paste the variables) into the sheet
But I have to think that the data extraction is already a solved problem -- bioinformaticians must do this all the time! Use the tools available for that and then import the data to the sheet in the usual, manual, way. Unless you are doing dozens there doesn't seem much need for a macro.