Creative Commons License
This blog by Tommy Tang is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

My github papge

Thursday, October 31, 2013

python code for getting the reverse complement DNA strand

Following pythonforbiologist http://pythonforbiologists.com/index.php/business-card-solutions/, I wrote a very simple python script to get the reverse complement DNA strand:


It is a very simple script but several things I want to mention:
1. what is the fast string concatenation method in python?
in the first function, we tend to write something like:

out_seq = ' '
for base in reversed(seq):
    out_seq += seq_dict[base]

but it turned out to be very slow. Read this post for more details  http://www.skymind.com/~ocrow/python_string/
the list comprehension is the fastest and most elegant way to concatenate a string.


2. for more complicated IUPAC ambiguity codes, read this post:
http://pythonforbiologists.com/index.php/how-to-count-non-dna-bases-in-a-sequence-using-python/
Nucleotide Code:  Base:
----------------  -----
A.................Adenine
C.................Cytosine
G.................Guanine
T (or U)..........Thymine (or Uracil)
R.................A or G
Y.................C or T
S.................G or C
W.................A or T
K.................G or T
M.................A or C
B.................C or G or T
D.................A or G or T
H.................A or C or T
V.................A or C or G
N.................any base
. or -............gap

12 comments:

  1. tanie i modne zegarki internetowy , combining elegant style and cutting-edge technology, a variety of styles of tanie i modne vacheron constantin zegarki internetowy , the pointer walks between your exclusive taste style.

    ReplyDelete
    Replies
    1. <Investment is one of the best ways to achieve financial freedom. For a beginner there are so many challenges you face. It’s hard to know how to get started. Trading the Crypto market has really been a life changer for me. I almost gave up on crypto currency at some point not until I got a proficient trader Bernie Doran, he gave me all the information required to succeed in trading. I made more profit than I could ever imagine. I’m not here to converse much but to share my testimony, I invested $2000.00 and got back $21,500.00 within 5 days of investment. His strategies and signals are the best and I have gained more knowledge.
      If you are new to cryptocurrency. You can reach to him on Telegram: @BERNIE_FX
      Or through Email : Bernie.doranfx01@gmail.com

      Delete
  2. Python Training in Delhi
    Thanks for sharing the information about the Python and keep updating us.This information is really useful to me.

    Python Classes in Delhi

    ReplyDelete
  3. All thanks to Mr Anderson for helping with my profits and making my fifth withdrawal possible. I'm here to share an amazing life changing opportunity with you. its called Bitcoin / Forex trading options. it is a highly lucrative business which can earn you as much as $2,570 in a week from an initial investment of just $200. I am living proof of this great business opportunity. If anyone is interested in trading on bitcoin or any cryptocurrency and want a successful trade without losing notify Mr Anderson now.Whatsapp: (+447883246472 )
    Email: tdameritrade077@gmail.com

    ReplyDelete
  4. SCAMS COME IN MANY FORMS, BUT ALL ARE DESIGNED TO GET A HOLD OF YOUR HARD-EARNED MONEY.
    The first mistake I made was thinking I could multiply my income by investing in cryptocurrency, I fell for a popular investment scam and was swindled of $60,000 in bitcoins. After a few weeks, I came across a pop-up while browsing the internet about a recovery team called Wardrivers Cyber Service that could help me recover my bitcoins in a matter of hours, I was doubtful about it at first but I finally contacted them and in a space of 48 hours, Wardrivers cyber-service was able to recover all of my money lost in bitcoins. They are the best bitcoins recovery team out there and if you face similar issues, you should contact them immediately.
    Contact information: Wardriverscyberservice@techie.com.

    ReplyDelete

  5. THE BEST AND MOST TRUSTED BITCOIN HACKER...

    I'M THE HAPPIEST WOMAN ON THE PLANET...I still can't believe my lost Bitcoin was recovered; Captain WebGenesis is a true godsend; I received my missing Bitcoin within 48 hours. I had read some fantastic testimonials about Captain WebGenesis before calling him and explaining how a bogus investment organization had stolen my Bitcoin and I needed assistance recovering it... Captain WebGenesis was so precise, I had no idea it would work so quickly for me... After hearing about my predicament, he did all humanly possible to recover my lost Bitcoin from those scammers. I volunteer to share my testimony with anyone else who has been fooled and requires the services of a recovery agency to reclaim their funds, that Captain WebGenesis is a genuine and trustworthy Bitcoin recovery agency that reclaims any bitcoin stolen from victims by fraudulent investment firms. Never give up on recovering your missing funds; please contact CAPTAIN WEBGENESIS from anywhere in the world at any time.

    E-MAIL: (Captainwebgenesis@hackermail.com)
    VERIFIED WEBSITE: https://captainwebgenesis.com
    CALL OR WHATSAPP +1 205 336 1020

    courtesy of Faith Tyler...

    ReplyDelete
  6. My misplaced cash of roughly $180k were found and recovered. I had my trading money unloaded by a broker who for three months refused to give me access to my trading account, and I had no idea that I would be able to recover it.
    i was able to get my money back without any hassle makes me quite happy. LION CYBER SECURITY COMPANY, who earned a reputation as a licensed binary options recovery specialist, is a technician I would really like to thank. Your broker manager is recommending that you make further deposits before making a withdrawal if you have money in your account that you intend to take out.
    Please get in touch with LION CYBER Recovery using the information below if you are unsure how to proceed. In a matter of days, they will demonstrate to you the guild lines to recover your stolen funds. Email: (lioncyberrr@gmail.com)
    WhatsApp +1 (929) 660-4485

    ReplyDelete
  7. The recovery process, which initially seemed daunting and nearly impossible, was completed within a few days thanks to their expertise. This outcome not only restored my lost capital but also provided a sense of vindication and closure. For anyone who finds themselves in a similar situation, I highly recommend seeking assistance from services like CYBER TECH WIZARD . Their expertise in dealing with unregulated brokers and financial scams is unparalleled, and their dedicated approach can make a significant difference in recovering lost funds. If you are struggling to withdraw money from an unregulated broker or facing complicated terms and conditions, reaching out to a reputable recovery service could be the key to reclaiming your investment. While losing $65,000 to an unregulated broker was a significant setback, the support from CYBER TECH WIZARD turned a challenging situation into a successful recovery. Their professionalism, expertise, and commitment to helping victims of financial fraud were instrumental in reclaiming my lost funds. If you find yourself in a similar predicament, do not hesitate to explore recovery options and seek the help of a trusted service. Financial recovery is possible, and with the right assistance, you too can overcome the challenges of dealing with fraudulent brokers. CONTACT INFO......+18597435022
    cybertechwizard@cyberservices.com

    ReplyDelete
  8. Cryptocurrency Tracing For Crypto Scam Recovery / Go to Captain WebGenesis.

    Victims of fraud have found it hard to come across legitimate crypto recovery companies to help them secure their lost investments from bogus investment websites. It's hard to take the pain of losing your hard earned money to fraudsters which can leave you in much debt and stress. If you're a victim of a Crypto scam or theft, I recommend Captain WebGenesis recovery team to provide help and get back your funds. Send a complaint to their email ( Captainwebgenesis@ hackermail. com ) and provide all the evidence required and the team will get into deep work and get back your lost crypto.

    SMS/WhatsApp; +1(501)436-9362.

    ReplyDelete
  9. +1 520 552 9379 WhaTsaP
    This week was incredibly distressing for me after I invested a significant amount of money into CoinPro, a trading platform that promised impressive returns. I was enticed by their offer of 25% interest on each trade, so I invested £205,000, believing it to be a wise financial decision. Unfortunately, it quickly became apparent that CoinPro was not as trustworthy as it appeared. My funds became effectively trapped, and I was unable to access them. This led to a great deal of anxiety and frustration as I watched my investment slip away.After days of struggling with the situation and feeling increasingly disheartened, I realized I needed professional help to resolve the issue. I began searching for a reliable fund recovery service and came across Cyber Tech Wizard (cybertech wizard@cyber services DOT com). Their positive reviews and success stories caught my attention, so I decided to reach out to their support team to explain my predicament. Cyber Tech Wizard responded promptly to my inquiry and requested specific information to start the recovery process. Despite my initial skepticism, their professional demeanor and clear communication provided reassurance. They assured me that they could handle the situation, and within just 12 hours, they were able to trace and track my stolen funds. This quick turnaround was both surprising and relieving.The recovery process itself was smooth and transparent. Cyber Tech Wizard kept me informed throughout every step of the process. I was particularly pleased to find that there were no hidden charges or unexpected fees, which often accompany such services. The entire £205,000 was recovered without any hassle, which was a tremendous relief after the prolonged period of uncertainty. Cyber Tech Wizard exceeded my expectations in terms of both speed and effectiveness. Their expertise and dedication turned what seemed like an impossible situation into a successful recovery. They provided a lifeline when I thought all hope was lost, and I am immensely grateful for their assistance. Their intervention made a significant difference, restoring not only my funds but also my peace of mind.If anyone finds themselves in a similar situation with funds that are stuck or lost, I highly recommend reaching out to Cyber Tech Wizard. Their commitment to their clients and their efficient handling of the recovery process can turn a difficult and stressful situation into a positive outcome. They have proven to be a reliable and effective resource in times of financial distress.

    ReplyDelete

  10. What To Do When Your Cryptocurrency is Lost or Stolen .

    Bitcoin recovery services offered At Captain WebGenesis recovery team are highly recommended to victims who have found themselves falling prey to Cryptocurrency scams and are desperately looking for steps to take and get back their lost funds. Captain WebGenesis has the best bitcoin recovery team to carry out your case investigation and provide solutions to your Crypto recovery problems. They provide their clients with tailor made Asset Recovery Plans that match their budget and take into account the individual aspects of the case, providing our clients with the best value for their hard earned money.

    Learn More; Captainwebgenesis. com
    Email Add; Captainwebgenesis@ hackermail. c om

    ReplyDelete
  11. WEB - https://cyber-genie-hackpro.info/
    Telegram - (@cybergeniehackpro)
    WhatsApp - +1 -2-5-2-2-7-1-8-9-0-0
    Mail - cybergenie(@)cyberservices(.)com

    I can't emphasize enough how badly I regret dealing with a fraudulent Crypto Broker. My dealings were an absolute disaster, and I will caution many so as not to be a victim of the crypto fraud trend. From the moment I signed up, endless promises were made by the trading platform, but it quickly became evident that their true motives and their company were far from true. After sending hundreds of thousands of dollars to my trading account within the first 3 months. The person in charge of my account was uncooperative, dismissive, and seemed more interested in getting me to put more money in than offering assistance. I was swayed to add more funds, assuring me of more huge profits, but in reality, they were exploiting my trust, sad. I wanted to access my funds but couldn't, at some point, I couldn't even access my trading account because they shut me out for not wanting to invest more. They demanded excessive paperwork, including numerous bank statements, which I complied with. Despite following their every instruction, the process became more and more delayed and complicated. Eventually, I realized they were purposely making it hard for me to withdraw my money, and I concluded that my crypto investment had been hijacked. They are nothing but scammers, and I deeply regret entrusting them with my money.
    I am writing this because I am just one of the few fortunate ones who got help in retrieving my lost investment. After some research, I realized that it's possible to retrieve crypto sent out of a crypto wallet if carried out by a professional crypto recovery specialist. I want to introduce you all to CYBER GENIE HACK PRO. This team of professional asset recovery specialists ensured all I had sent out was successfully recovered immediately after I hired them. I highly suggest CYBER GENIE HACK PRO as the best crypto asset specialist on the internet. Their professionalism, support, and communication are what kept me glued to them; All hope was lost at some time, but guess who restored my hope, CYBER GENIE HACK PRO.

    ReplyDelete