• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openvax / varcode / 9781104697

03 Jul 2024 03:56PM UTC coverage: 88.33% (-6.4%) from 94.753%
9781104697

Pull #253

github

kodysy02
Defaulting convert_ucsc_contig_names to True for consistency with past behavior
Pull Request #253: Defaulting convert_ucsc_contig_names to True for consistency with past behavior

1 of 1 new or added line in 1 file covered. (100.0%)

144 existing lines in 17 files now uncovered.

1544 of 1748 relevant lines covered (88.33%)

2.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

58.33
/varcode/effects/transcript_helpers.py
1
# Licensed under the Apache License, Version 2.0 (the "License");
2
# you may not use this file except in compliance with the License.
3
# You may obtain a copy of the License at
4
#
5
#     http://www.apache.org/licenses/LICENSE-2.0
6
#
7
# Unless required by applicable law or agreed to in writing, software
8
# distributed under the License is distributed on an "AS IS" BASIS,
9
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
# See the License for the specific language governing permissions and
11
# limitations under the License.
12

13

14
def interval_offset_on_transcript(start, end, transcript):
3✔
15
    """
16
    Given an interval [start:end] and a particular transcript,
17
    return the start offset of the interval relative to the
18
    chromosomal positions of the transcript.
19
    """
20
    # ensure that start_pos:end_pos overlap with transcript positions
21
    if start > end:
3✔
UNCOV
22
        raise ValueError(
×
23
            "start_pos %d shouldn't be greater than end_pos %d" % (
24
                start, end))
25
    if start > transcript.end:
3✔
UNCOV
26
        raise ValueError(
×
27
            "Range %d:%d starts after transcript %s (%d:%d)" % (
28
                start,
29
                end,
30
                transcript,
31
                transcript.start,
32
                transcript.end))
33
    if end < transcript.start:
3✔
UNCOV
34
        raise ValueError(
×
35
            "Range %d:%d ends before transcript %s (%d:%d)" % (
36
                start,
37
                end,
38
                transcript,
39
                transcript.start,
40
                transcript.end))
41
    # trim the start position to the beginning of the transcript
42
    if start < transcript.start:
3✔
43
        start = transcript.start
×
44
    # trim the end position to the end of the transcript
45
    if end > transcript.end:
3✔
46
        end = transcript.end
×
47
    # return earliest offset into the spliced transcript
48
    return min(
3✔
49
        transcript.spliced_offset(start),
50
        transcript.spliced_offset(end))
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc