Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7854407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:03:33+00:00 2026-06-02T20:03:33+00:00

I want to get to a certain point on a string that is opposite

  • 0

I want to get to a certain point on a string that is opposite (from the negative side) to that of what I am given.

AAAAAAAAAACCCCCCCCCCTTTTTTTTTTGGGGGGGGGG
TTTTTTTTTTGGGGGGGGGGAAAAAAAAAACCCCCCCCCC

So you need to convert coordinates. On the bottom strand, base 0 (the right-most C) is opposed to base 39 on the top strand. Base 1 is against base 38. Base 2 is against case 37. (Important point: notice what happens when you add these two numbers up — every time.) So base 10 is against base 29, and base 19 is against base 20.

So: if I want to find base 10-20 on the bottom strand, I can look at base 20-29 on the top (and then reverse-complement it).

I have written the following:

fp = open(infile, 'r')
for line in fp:
   tokens = line.split()
   exonstarts = tokens[8][:-1].split(',')
   exonends = tokens[9][:-1].split(',')
   zipped = list(zip(exonstarts, exonends))
   chrom_len = len(chr_string)
   s = ''.join(bc[base.upper()] for base in chr_string[-starts-1:-ends-1] for starts, ends in zipped)+'\n'

Yet, every time I do this I get:

Error: global name ‘starts’ is not defined

How do I fix this??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:03:34+00:00Added an answer on June 2, 2026 at 8:03 pm

    Try adding parentheses around the last term:

    s = ''.join(bc[base.upper()] for base in (chr_string[-starts-1:-ends-1]\
                                             ^
                for starts, ends in zipped)) +'\n'
                                          ^
    

    Your defining two different generators here. This is equivalent to:

    strands = (chr_string[-starts-1:-ends-1] for starts, ends in zipped)
    complementary_strands = (bc[base.upper()] for base in stage_1)
    joined_exons = ''.join(stage_2) + '\n'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want get all of the Geom objects that are related to a certain
I want to get triples about cities, which are from certain country. How can
I want get as much as possible from Redis + Hiredis + libevent. I'm
I want to get the text value of a textbox from javascript. The textbox
I want to insert a text string inside another one after certain number or
I want to get the pitch of a song at any point. I plan
I have a github-based git repository that represents development up to a certain point,
I want get the time used for a case so I can create an
I just want get a 2 dimension array of List in c#. In my
I want to get a statistic of how many users submitted content each month

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.