There was a comment on another thread about gettin...
# sarek_dev
s
There was a comment on another thread about getting vcf output into Excel, so I'm going to make sure I mention this new tool I saw but haven't used: https://github.com/flalom/vcf-reformatter
a
Heh I actually saw this myself last week. No idea how well it works but it’s pretty clearly AI generated. I have also been wrangling VCF into Excel and honestly I just wish there was some other tool to view tabular data. All your GT getting turned into 01-JAN or something similar so the user makes you change the format to
1//1
😭
🫣 2
facepalm 1
s
What makes you think it is AI generated?
a
The excessive use of emojis, including within the code is the main giveaway. Also the comments are quite typical of AI stuff I have generated. Quite possible the guy does know what he's doing but it makes me wary when I haven't verified it myself. (For
ANN
extraction it would keel over if the file has eg
SVANN
as a field too)
s
I think all the emojis are within the printing output, but fair enough. you should file an issue regarding the ANN extraction 😉
a
I have been using a python script with
polars
to do my transformations for now. Performance seems reasonable enough over ~30k variants. I’m not sure if using bcftools query to explode the
INFO
field first might be quicker overall, but ultimately I need some custom column formatting/extraction so I have to run through something like python really.
t
I always use
bcftools
. With the
+split-vep
plugin it is quite powerful (but there is a learning curve and it has some gotchas and probably even bugs). Any post processing I do with
awk
,
perl
, and/or
R
(R can generate Excel files without the "date conversion" issue, even with conditional formatting, etc. -- much nicer to script such things than do them manually; but either way, Excel should always only be the "end product", never the input for something else -- that way errors stay contained).
a
I assume the R thing is actually making excel files? I don't want an excel file though. I want a tabular format that can be opened in Excel if needed.
t
R can do either. I usually make TSV tables, which I open in Excel if needed. But if I want to have an Excel file for colors and stuff to share with collaborators, I use the
openxlsx
library.
a
But I don’t understand how R can prevent the date-format issue in a plain TSV?
t
The problem with the "date" issue is that Excel "interprets" the numbers and strings in a TSV and has been programmed to interpret things very freely, so the SEPT7 (Septin-7) gene/protein will be converted to the date September 7 (of the current year). If R creates a TSV with
SEPT7
in it, Excel will interpret it as a date. But if R creates an
*.xlsx
file, it will make sure that this particular cell is formatted as a string, not a number with date format. (So you could make R create both a TSV and
xlsx
file, and use each for its own purpose.) Apparently there are (now) some settings in Excel that can be set to prevent it from trying to (over)interpret things, but I don't use Excel and don't know any details (because LibreOffice Calc is not so stupid). There are, however, many websites devoted to this problem, as well as several supposed solutions.
a
Yeah ok, so it’s what I thought. The R thing is because you are making actual
xlsx
files. Kind of shocking to me that some other lightweight tabular format viewer is not more widely available or used. (I just like opening stuff in VSCode with column justification, but even that sometimes craps out on v-large files).
t
I use
column -ts $'\t' $tsvfile | less -S
, which works quite well for me (
less
has regex search functionality, etc.), but of course not for people who expect a GUI ...
a
Yeah I think I’d have a hard time convincing analysts to move from Excel to
less
😂
😂 1
t
If you want the full Excel functionality without the stupidity, LibreOffice Calc is available for all major operating systems. The only thing I don't like is that it can get slow with very large data and lots of conditional formatting (which may need to be recalculated).