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

subset FASTX.FASTQ.Record #89

Closed
Liripo opened this issue Nov 10, 2022 · 2 comments
Closed

subset FASTX.FASTQ.Record #89

Liripo opened this issue Nov 10, 2022 · 2 comments

Comments

@Liripo
Copy link

Liripo commented Nov 10, 2022

There does not seem to be a convenient operation to subset the record directly!

julia> FASTX.FASTQ.Record("@name","ATC","!!!")[1:2]
ERROR: MethodError: no method matching getindex(::FASTX.FASTQ.Record, ::UnitRange{Int64})
@jakobnissen
Copy link
Member

That's correct. To subset a record, you must construct a new one:

julia> rec = FASTX.FASTQ.Record("@name","ATC","!!!");

julia> FASTQRecord(
           description(rec),
           sequence(rec)[1:2],
           quality(rec)[1:2]
       )
FASTQ.Record:
  description: "@name"
     sequence: "AT"
      quality: "!!"

I could add that - that wouldn't be too hard.

@Liripo
Copy link
Author

Liripo commented Nov 10, 2022

Thank you for your quick reply! It would be great to add this note to the documentation.

@Liripo Liripo closed this as completed Nov 10, 2022
This issue was closed.
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

No branches or pull requests

2 participants