Earlier quoted context omitted.
I watched a talk by someone in the intelligence community space nearly 8 years ago talking about the data dirt that most companies and spy agencies are combing through and the kind of abstract research that will be necessary to turn that into something consumable by all the stuff that private sector seems to be selling and hyping. So I think the old guard big data folks collecting yottabytes of crap across the world…
> In academia, who the heck gets a doctorate for advancements in cleaning up arbitrary data to feed into ML models Well - Alex Ratner [stanford], for one: https://ajratner.github.io/ And several of Chris Re's other students have as well: https://cs.stanford.edu/~chrismre/ Trifacta is Joseph Hellerstein's [berkeley] startup for data wrangling: https://www.trifacta.com/ Sanjay Krishnan [berkeley]: http://sanjayk.io/
Using AWK and R to parse 25TB
81–90 of 106 posts
Re: Using AWK and R to parse 25TB
#82Unix pipelines, AWK, gnu parallel, R, all great stuff. If you have such an specific task, why not just write an "actual program" (as opposed to pipeline of scripts)? From the looks of it, it sounds like this problem could have been solved with, say, 50 lines of Java, C, Go, etc, etc. Maybe a bit more verbose but it would give you full control, you wouldn't need to lookup how to use command line parameters on S/O, and…
Dealing with exceptions is extremely error prone if these exceptions are not mapped beforehand. Thus it can be very costly.
Similarly doing stuff in parallel is extremely error prone due to race conditions: What does not happen when running on your 1 GB test set, may very well happen when running on your 25 TB production data.
Re: Using AWK and R to parse 25TB
#83Very well written. I think using 'make' with the -j parameter (# of parallel jobs) is more useful than using gnu 'parallel'. The reason is that if one of the job fails for some reason, you just re-run 'make' and only the required jobs are started instead of restarting the entire computation.
Re: Using AWK and R to parse 25TB
#84Have used Mawk [1] in similar cases for a runtime savings, provided that the script works without any GNU Awk extensions. [1] https://invisible-island.net/mawk/
Do you know why?
Re: Using AWK and R to parse 25TB
#85What's the best pipeline/workflow management tool for command line programs with a GUI? E.g. for resuming the process after it gets interrupted etc.
Task-splitting itself is inherently recoverable, as incomplete work units don't produce the final output you're looking for, and can. be retried, re-run, or re-entered into the task pool.
A GUI quite frankly simply gets in the way.
Re: Using AWK and R to parse 25TB
#86Can someone add "join" to the language/standard please. Its awkward to have split but not join.
paste - merge lines of filesRe: Using AWK and R to parse 25TB
#87Very well written. I think using 'make' with the -j parameter (# of parallel jobs) is more useful than using gnu 'parallel'. The reason is that if one of the job fails for some reason, you just re-run 'make' and only the required jobs are started instead of restarting the entire computation.
Re: Using AWK and R to parse 25TB
#88Unix pipelines, AWK, gnu parallel, R, all great stuff. If you have such an specific task, why not just write an "actual program" (as opposed to pipeline of scripts)? From the looks of it, it sounds like this problem could have been solved with, say, 50 lines of Java, C, Go, etc, etc. Maybe a bit more verbose but it would give you full control, you wouldn't need to lookup how to use command line parameters on S/O, and…
I have done that more than once. I often end up with a solution that works on the test set but which breaks after 10 TB just because is a valid email address according RFC-822 (Who the f * thought it was a good idea to allow spaces in email addresses?). Or some other exception that was not part of the test set, and that was not identified before starting. Dealing with exceptions is extremely error prone if these exce…
In a program I'd try/catch defensively "just in case", if missing one line out of 25TB is not a bit deal.
For parallel processing I'd reach for the nearest standard library at hand on the language of choice.
Re: Using AWK and R to parse 25TB
#89If you only need a single SNP or a group of SNPs within a region, you can use tabix[1] to index gzipped TSVs and query by genomic position. The position of SNPs can be obtained from a lookup table (2.5M is not very big even for R) or from an API if you were to say - query by rsid.
tabix also works over http (and s3) and can utilize RANGE queries to select a subset of a file...so you only wind up downloading a or reading a small portion once it is indexed and can do something like this:
tabix https://www.file.url.tsv chr1:1-1000
The command above would return variants on chromosome 1 between 1 and 1000.
The following variant browser works in this way: https://elegansvariation.org/data/browser/ - Theres no formal database (e.g. MySQL) running here, just tabix (actually bcftools which uses tabix) to select variants in a particular region, wrap them in JSON, and return to the client.
Setting this up on S3 requires configuring CORS... the igv browser also uses tabix indexes and provides guidance on how to set this up [2]
[1] https://www.htslib.org/doc/tabix.html [2] https://github.com/igvteam/igv.js/wiki/Data-Server-Requireme...
I created a similar solution to what you have done using this alternative approach, writing a wrapper in R that invoked bcftools under the hood. The dataset I was working with was a lot smaller (1.6M Snps x 252 individuals), but should work with larger genotype sets as well.