Skip to content

Commit

Permalink
Update clj-hgvs to 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
totakke committed Aug 16, 2019
1 parent 62f7049 commit f96d12f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:min-lein-version "2.7.0"
:dependencies [[org.clojure/clojure "1.10.1" :scope "provided"]
[org.clojure/tools.logging "0.4.1"]
[clj-hgvs "0.3.1"]
[clj-hgvs "0.4.0"]
[cljam "0.7.2"]
[org.apache.commons/commons-compress "1.18"]
[proton "0.1.8"]]
Expand Down
4 changes: 2 additions & 2 deletions src/varity/hgvs_to_vcf.clj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
([hgvs seq-rdr rgidx] (hgvs->vcf-variants hgvs nil seq-rdr rgidx))
([hgvs gene seq-rdr rgidx]
(let [convert (case (:kind hgvs)
:cdna cdna-hgvs->vcf-variants
:coding-dna cdna-hgvs->vcf-variants
:protein protein-hgvs->vcf-variants)
rgs (if-let [[rs] (re-find #"^(NM|NR)_\d+" (str (:transcript hgvs)))]
(rg/ref-genes rs rgidx)
Expand All @@ -68,7 +68,7 @@
([hgvs seq-rdr rg] (hgvs->vcf-variants hgvs nil seq-rdr rg))
([hgvs _ seq-rdr rg]
(let [convert (case (:kind hgvs)
:cdna cdna/->vcf-variant
:coding-dna cdna/->vcf-variant
:protein prot/->vcf-variants)]
(convert hgvs seq-rdr rg))))

Expand Down
2 changes: 1 addition & 1 deletion src/varity/hgvs_to_vcf/cdna.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
(defn- cds-coord->genomic-pos
[coord rg]
(cond
(instance? clj_hgvs.coordinate.CDNACoordinate coord)
(instance? clj_hgvs.coordinate.CodingDNACoordinate coord)
(rg/cds-coord->genomic-pos coord rg)

(or (instance? clj_hgvs.coordinate.UnknownCoordinate coord)
Expand Down
2 changes: 1 addition & 1 deletion src/varity/hgvs_to_vcf/protein.clj
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
:pos ((if reverse? last first) ps),
:ref (cond-> ref reverse? util-seq/revcomp),
:alt (cond-> alt reverse? util-seq/revcomp)},
:cdna (hgvs/hgvs (:name rg) :cdna mut)}))))))))))
:cdna (hgvs/hgvs (:name rg) :coding-dna mut)}))))))))))
(throw (IllegalArgumentException. "Unsupported mutation"))))

(defn ->vcf-variants-with-cdna-hgvs
Expand Down
2 changes: 1 addition & 1 deletion src/varity/ref_gene.clj
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
(and tx-edge? (= region :upstream)) [(- cds-pos* offset) 0]
(and tx-edge? (= region :downstream)) [(+ cds-pos* offset) 0]
:else [cds-pos* offset])]
(coord/cdna-coordinate cds-pos* offset region)))
(coord/coding-dna-coordinate cds-pos* offset region)))

;;; Calculation of genomic coordinate

Expand Down
2 changes: 1 addition & 1 deletion src/varity/vcf_to_hgvs/cdna.clj
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
(defn ->hgvs
[{:keys [pos ref alt]} seq-rdr rg]
(hgvs/hgvs (:name rg)
:cdna
:coding-dna
(mutation seq-rdr rg pos ref alt)))

(defn- sequence-pstring
Expand Down
4 changes: 2 additions & 2 deletions test/varity/ref_gene_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
(deftest cds-coord->genomic-pos-test
;; 1 [2 3 4] 5 6 7 [8 9 10 11] 12 13 14 15
(testing "strand +"
(are [c s e r] (= (rg/cds-coord->genomic-pos (coord/parse-cdna-coordinate c)
(are [c s e r] (= (rg/cds-coord->genomic-pos (coord/parse-coding-dna-coordinate c)
{:strand :forward
:cds-start s
:cds-end e
Expand All @@ -287,7 +287,7 @@
"-5" 9 11 1
"*7" 2 3 13))
(testing "strand -"
(are [c s e r] (= (rg/cds-coord->genomic-pos (coord/parse-cdna-coordinate c)
(are [c s e r] (= (rg/cds-coord->genomic-pos (coord/parse-coding-dna-coordinate c)
{:strand :reverse
:cds-start s
:cds-end e
Expand Down

0 comments on commit f96d12f

Please sign in to comment.