arq5x / gemini

a lightweight db framework for exploring genetic variation.
http://gemini.readthedocs.org
MIT License
319 stars 120 forks source link

Query on samples table creates blank lines in output #386

Closed oleraj closed 9 years ago

oleraj commented 9 years ago

This is pretty low priority, but I just noticed that after updating gemini (--devel) when I do a query on the samples table that there are blank lines between the output lines (two line returns?).

gemini query --header -q "select * from samples" my.db 
sample_id   family_id   name    paternal_id maternal_id sex phenotype
1   Fam1    DS-125367   DS-134795   DS-134794   1   2

2   Fam1    DS-134794   0   0   2   1

3   Fam1    DS-134795   0   0   1   1

I don't see this when I query other tables (e.g., variants, gene_detailed, gene_summary, etc.).

gemini query --header -q "select * from gene_summary" my.db | head
uid chrom   gene    is_hgnc ensembl_gene_id hgnc_id transcript_min_start    transcript_max_end  strand  synonym rvis_pct    mam_phenotype_id    in_cosmic_census
1   chrHG991_PATCH  SLC25A26    1   ENSG00000261657 20661   66119285    66465398    1   None    48.11866006 None    0
2   chr13   None    0   ENSG00000223116 None    23551994    23552136    -1  None    None    None    0
3   chr13   HMGA1P6 1   ENSG00000233440 19121   23708313    23708703    1   HMGA1L6 None    None    0
chapmanb commented 9 years ago

Thanks so much for catching this. Apologies, I added in support for tab delimited PED files with spaces in columns, but didn't realize the previous approach implicitly chopped off the newline. It now does this explicitly for the tab delimited case as well so should no longer have this issue if you re-load the database (or PED file). Sorry about the issue and thanks again for catching it.

oleraj commented 9 years ago

It works! Thanks for the fix.