Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect --exclude-flags 0 #121

Merged
merged 1 commit into from
Dec 21, 2024
Merged

Conversation

xunjieli
Copy link
Contributor

Update tracks.py to set duplicate and vendorFailed in Bam track's options to True. Otherwise, igv.js will filter out duplicate and vendorFailed reads even though --exclude-flags is 0.

Since pysam filters out reads before serializing the data into data url, this PR fixes this bug by making igv.js to show all reads.

Update tracks.py to set duplicate and vendorFailed in Bam track's options to True. Otherwise, igv.js will filter out duplicate and vendorFailed reads even though `--exclude-flags` is 0.

Since pysam filters out reads before serializing the data into data url, we can make igv.js to show all reads.
@xunjieli
Copy link
Contributor Author

@jrobinso PTAL. To reproduce the bug,

  • have a few reads that are marked vendorFailed or PCR duplicates.
  • pass --exclude-filter 0 when creating a report.
  • Observe that the HTML generated will filter out reads even though user explicitly specified --exclude-filter 0

@jrobinso
Copy link
Contributor

I don't understand this change, it looks like you are turning off vendor failed and exclude duplicates flags irrespective of input flags.

@xunjieli
Copy link
Contributor Author

I don't understand this change, it looks like you are turning off vendor failed and exclude duplicates flags irrespective of input flags.

The input flag (i.e. --exclude-flag) is passed to pysam for filtering out reads here:

return pysam.view(*samargs)
Therefore, the reads serialized into data url will respect --exclude-flag. However, because igv-reports isn't setting igv.js options right, igv.js will additionally filter out vendor failed and duplicates.
To respect --exclude-flag, igv-reports needs to turn off all default reads filtering in igv.js and make igv.js display all reads , as the reads being serialized into data urls have gone through filtering (by pysam).

@jrobinso
Copy link
Contributor

If you wish to customize igv options for a track you can do that with the --track-configs option.

@xunjieli
Copy link
Contributor Author

Ok great. Thanks. That seems to work. For anyone else, the --track-config should look like

[
    {
      "name": "Alignments",
      "url": "path/to/bam.bam",
      "filter": {
        "duplicate": false,
        "vendorFailed": false
      }
    }
]

@xunjieli xunjieli closed this Dec 20, 2024
@jrobinso
Copy link
Contributor

I'm going to reopen as a reminder to allow pass-thru flags to pysam, I was just suggesting --track-config as a workaround.

@jrobinso jrobinso reopened this Dec 21, 2024
@jrobinso
Copy link
Contributor

Oh disregard, you can already do that. Sorry for confusion, too many projects.

@jrobinso jrobinso closed this Dec 21, 2024
@jrobinso
Copy link
Contributor

Actually I just understood the logic of this PR, I think your solution is fine. Sorry for my confusion.

@jrobinso jrobinso reopened this Dec 21, 2024
@jrobinso jrobinso merged commit 9b8246a into igvteam:master Dec 21, 2024
@xunjieli xunjieli deleted the xunjieli-patch-2 branch December 22, 2024 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants