stianlagstad / chimeraviz

chimeraviz is an R package that automates the creation of chimeric RNA visualizations.
37 stars 14 forks source link

Column Header Issue with importStarfusion.R Function #4

Closed drmrgd closed 6 years ago

drmrgd commented 7 years ago

Hi, As of v0.8.0 of STAR-Fusion, it would seem that the column headers of the 'star-fusion.fusion_candidates.final.abridged' have changed, which is causing an error when trying to import the file using importStarfusion.R:

Reading filename caused a warning:
Error in vector("list", dim(report)[1]) : invalid 'length' argument
In addition: Warning message:
The following named parsers don't match the column names: #fusion_name, JunctionReads, SpanningFrags, Splice_type

It looks like in this version of STAR-Fusion, the column headers and data are as follows:

#FusionName JunctionReadCount   SpanningFragCount   SpliceType  LeftGene    LeftBreakpoint  RightGene   RightBreakpoint LargeAnchorSupport  LeftBreakDinuc  LeftBreakEntropy    RightBreakDinuc RightBreakEntropy
FGFR3--AC016773.1   5051    0   INCL_NON_REF_SPLICE FGFR3^ENSG00000068078.13    chr4:1808661:+  AC016773.1^ENSG00000218422.2    chr4:1741429:+  YES_LDAS    GT  1.8892  AG  1.7819
FGFR3--TACC3    4014    0   ONLY_REF_SPLICE FGFR3^ENSG00000068078.13    chr4:1808661:+  TACC3^ENSG00000013810.14    chr4:1741429:+  YES_LDAS    GT  1.8892  AG  1.7819
FGFR3--TACC3    1033    0   INCL_NON_REF_SPLICE FGFR3^ENSG00000068078.13    chr4:1808663:+  TACC3^ENSG00000013810.14    chr4:1741432:+  YES_LDAS    GA  1.8892  TA  1.5219
TBL1XR1--PIK3CA 8   0   ONLY_REF_SPLICE TBL1XR1^ENSG00000177565.11  chr3:176914909:-    PIK3CA^ENSG00000121879.3    chr3:178916538:+    YES_LDAS    GT  1.8892  AG  1.6895
BHLHE40--MT-CYB 3   0   INCL_NON_REF_SPLICE BHLHE40^ENSG00000134107.4   chr3:5025126:+  MT-CYB^ENSG00000198727.2    chrM:14815:+    YES_LDAS    CT  1.7465  AC  1.4566

I manually edited the file and verified that import is successful if I change the column headers to match what the function is expecting.

stianlagstad commented 7 years ago

Thank you for the bug report! :)

The import-function should support both the new version of the result file from STAR-Fusion as well as the old one, don't you think? I could add a parameter to the import function that lets the user specify which version they have used (for example importStarfusion(filename, version="0.8.0")), and let the default value be the most recent version. What do you think?

drmrgd commented 7 years ago

Thanks for the quick reply! I think that might make a lot of sense to do it that way in order to ensure that most users would have some flexibility. I looked through the data and I can't think of a programmatic way to do this. So, adding a parameter to the function is a great idea.

stianlagstad commented 7 years ago

Note that any API changes (such as adding a new parameter) requires me to do the change in the development version of chimeraviz, which is harder to use for the average user. Then the change will not be available in the release version until the next Bioconductor release. So I I'll do this:

drmrgd commented 7 years ago

Thank you very much, I think this will work fine! I think the timing is probably ok, as it's fairly easy to change the header of the STAR-Fusion output to make the expectations chimeraviz in the event there is an issue. I really appreciate the quick help!

stianlagstad commented 7 years ago

That's taken care of. After the next nightly Bioconductor build importStarfusion will work with the new format :)

I'll leave this issue open so that I'll remember to implement the version-parameter in devel.

stianlagstad commented 6 years ago

I've changed my mind about this one. The problem with accepting a "verison" parameter is that the fusion finders will probably many times without actually updating their output format. If chimeraviz were to take a "version" parameter, I would have to add each valid version mapped to each potential output format. I think it would be easier to just stay on top of the outputs of the most recent versions, and if anynoe needs help using a previous version I'll just help writing a custom script for that.