Skip to content

Commit

Permalink
2024/10/28-11:02:53 (Linux VDI0092.zit.bam.de x86_64)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbenner committed Oct 28, 2024
1 parent d1b0414 commit 8838a3e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,14 @@ use crate::granges::GRanges;
let granges = GRanges::import_gtf("src/granges_gtf.gtf",
vec!["gene_id", "gene_num"], // Names of optional fields
vec!["str" , "int" ], // Types of optional fields
vec![]
vec![None , Some("0") ], // Default values, can be an empty vector if omitted
).unwrap();

```
The result is:
```bash
seqnames ranges strand | source feature gene_num gene_id
1 1 [11869, 14409) + | transcribed_unprocessed_pseudogene gene 1 ENSG00000223972
2 1 [11870, 14410) + | processed_transcript transcript 2 ENSG00000223972
2 1 [11870, 14410) + | processed_transcript transcript 0 ENSG00000223972
```
### Read a BAM file into a GRanges object
Expand Down
2 changes: 1 addition & 1 deletion src/granges_gtf.gtf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
1 transcribed_unprocessed_pseudogene gene 11869 14409 . + . gene_id "ENSG00000223972"; gene_name "DDX11L1"; gene_source "havana"; gene_biotype "transcribed_unprocessed_pseudogene"; gene_num "1";
1 processed_transcript transcript 11870 14410 . + . gene_id "ENSG00000223972"; transcript_id "ENST00000456328"; gene_name "DDX11L1"; gene_source "havana"; gene_biotype "transcribed_unprocessed_pseudogene"; transcript_name "DDX11L1-002"; transcript_source "havana"; gene_num "2";
1 processed_transcript transcript 11870 14410 . + . gene_id "ENSG00000223972"; transcript_id "ENST00000456328"; gene_name "DDX11L1"; gene_source "havana"; gene_biotype "transcribed_unprocessed_pseudogene"; transcript_name "DDX11L1-002"; transcript_source "havana";
2 changes: 1 addition & 1 deletion src/granges_gtf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ mod tests {
let granges = GRanges::import_gtf("src/granges_gtf.gtf",
vec!["gene_id", "gene_num"], // Names of optional fields
vec!["str" , "int" ], // Types of optional fields
vec![]
vec![None , Some("0") ], // Default values, can be an empty vector if omitted
).unwrap();

assert_eq!(granges.num_rows(), 2);
Expand Down

0 comments on commit 8838a3e

Please sign in to comment.