Coin Flip: Variable decides between values

I have several RNA sequences:
gggagauuAGUCAU(g/c)UAAGuuUACAAUC(u/a)CGCuuGUA(g/c)AUCGUAGuuGU(u/a)GU
ggcgcuuuGAC(u/a)CUUCUGCuuauguccC(u/a)CUAuuCUUA(g/c)AUGACUuuGG(u/a)CC
ggcaacuugaucccUC(u/a)GGuuagcgccGG(u/a)CCuuucucccAC(u/a)ACuuCAC(u/a)G
gggaucuuACCUAC(u/a)CACGuuUGCUG(u/a)UCUCGuuGCAGAAG(u/a)GUCuuCC(u/a)GA
ggacauuuCGAGA(u/a)CAGCAuu(g/c)uuucccGACCuuGCG(u/a)GAUUGUAuuUAG(u/a)G
gggaaa(g/c)uuCGUG(u/a)GUAGGUuuguugccC(u/a)GUGuuCUACGAU(g/c)UACuuGGUC
You'll notice there are several instances of '(g/c)' and '(u/a)', where the nucleotide can be either G or C or either A or U.
I need print all the possible sequences that can be made from the above six. In other words, I need to implement a 'coin flip' that decides between C/G or A/U every time '(g/c)' or '(u/a)' appears. All-in-all there are over one million possible sequences.
How can I do this?

It doesn't seem to me that there will be millions of possible combinations. In fact, if I understand the problem correctly, I think there are two possible options for each of the a/u or g/c nucleotides. Since there are four of them in each of the six strings, each string has 2^4 possible permutations, or 16 Thus, the way I see it, you have 16*6 = 96 possible strings to work from. What I would do is enumerate these 96 strings, placing them into a list or collection of some kind. Then, you have the ability to use each of these strings as necessary to build up your overall RNA string.
If the final RNA string must be a combination of exactly 6 of these strings, with no repetition, then you have 96 *95 *94 *93 *92 *91 = 6,674,768,880, which might be (I suppose) where you got your original answer.
Assuming I understand this correctly, you probably don't want to enumerate all of these. What it seems like you're asking is how to simulate the possibility of randomness developing in the final RNA sequence. So, I think the problem is better stated like:
Given these 6 sequences of RNA, how can I build a single string such that at each possible (a/u) or (g/c) each of the possible choices has a 50% possibility of being present at that location?
If this is what you're looking for, then I think a better algorithm is to build the enumerations of the RNA strings such that the g/c and a/u choices are intact, and then begin traversing through it, each time you run the experiment, calculating a new random variable at each of the parenthesized points in the RNA string. This will not produce unique strings, but will be like a simulation of RNA construction.
Edited by: jwir3 on Jan 29, 2010 11:48 AM

Similar Messages

  • Deciding between iMac and Mac Pro

    My current desktop computer (a PC) is basically dead. It is under extended warrenty but the custom build place I got it from tells me nothing is covered (because of their negligence but they won't admit that) And basically they want me to pay out of pocket for a brand new computer.
    However after having a Macbook Pro for a year and loving it I decided to just change my desktop over to a Mac which I want to purchase by the end of October (or if this computer gives out before then earlier) However I just can't decide between an iMac or a Mac Pro.
    The 2 big things are video editing at the moment just Final Cut Express and gaming when/if I get a chance. The iMac I'm looking at is the 3.06 GHz, with 4 GB ram, and a Geforce 8800GS video card. On the Mac Pro side it'd be more or less the Stock Mac Pro with 2.8 GHZ Quad core x2, 4 GB Ram, and I'd purchase the ATI HD 3870 video card for it.
    The other difficulty is I do need a new monitor as well with the iMac a new monitor isn't an issue but with the Mac Pro it's extra and I guess I'm trying to debate if the difference between the 2 computers is really worth the cost. I'd like for the new computer to last me 3-4 years maybe a bit longer so it's just a matter of which is better for my needs. Is the Mac Pro really worth it over the iMac? I know I cant replace anything in the iMac but if it can do me for awhile I don't see why that'd be a downside
    The other factor is, buying at the end of october, is it wise or should I try and get as much life out of my dead PC and try and wait for the next iMac/Mac Pro refresh?
    Thank you to everyone who replies with their opinions.

    The biggest advantage of the MacPro is its expandability. Yes, it is faster too, but is the speed difference worth the extra cost? Looking at what you can expand in a MacPro (unlike PCs which can be swapped out component by component until nothing but the case is original equipment) I decided that expandability was too limited to be worth the price and the speed increase wasn't either.
    In the past I'd bought a Mac tower and kept it 5 years, over those five years upgrading the graphics card, swapping out the CPU, bigger drives, etc. I looked at the MacPro and concluded there wasn't much I would or could do to expand it other than a bigger hard drive or more hard drives and more memory. Maybe a better graphics card. Meanwhile, I could buy an iMac, keep it for 2 1/2 years, sell it, buy a new iMac and keep it for 2 1/2 years and wind up spending less (thanks to the high resale values of Macs).

  • Whats the difference betweeen passing the table variable and table valued parameter?

    Hi Everbody
      Can someone one tell me what's the difference between passing a table variable and table valued parameter to a stored procedure or function? Can both be used to pass a table to a stored procedure/function?
    Regards
    Regards

    They are essentially the same. What we call a table variable is a local
    variable. A table-valued parameter is an incoming parameter to the
    procedure. The only difference is that the parameter is readonly.
    When you call a stored procedure, you can pass a table variable as the
    actual parameter. Or a table-valued parameter that you pass on.
    CREATE PROCEDURE nisse_sp @tvp sometype READONLY AS
    DECLARE @local someothertabletype
    EXEC pelle_sp @tvp, @local
    Erland Sommarskog, SQL Server MVP, [email protected]

  • A variable with multiple values. Is it possible?

    Normally, when we need a variable with multiple values we just write them while creating the variable or, if they depend on some other variable selected by the user a variable of type exit is used.
    However, this time we would like my user to select <b>a few</b> variable values <b>at a time</b>, i.e years 2005,2006 and 2007. He can change his mind and then select 2007 and 2008. I don't want the user to be forced to select ONLY ONE value. They need to select several values at the same time.
    Ideally, I don't want to use a range with values from 2 variables to do that.
    Thanks,
    Alberto Sabate
    Message was edited by: Alberto Sabate

    Hello Alberto,
    When restricting variables to multiple values you need to use a range. The variable restriction in BPS supports two operators EQ - equals and BT - between.
    In your example below however you could use a user exit to support this. The years you have typed in below are sequential and therefore would fit into a range.
    Cheers,
    Scott

  • Preserve variable type between handlers

    How can I make a script like the following preserve variable type between handlers?
    global theURLs
    set theURLs to "http://www.reddit.com/,www.google.com"
    testVar1(theURLs)
    testVar2(theURLs)
    on testVar1(theURLs)
              if theURLs contains "," then
                        set {myTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {","}}
                        set theURLs to text items of theURLs
                        set AppleScript's text item delimiters to myTID
              end if
              return theURLs
    end testVar1
    on testVar2(theURLs)
              return theURLs
    end testVar2
    testVar1 returns a list, while testVar2 returns text.

    The other answers helped me emend my script.
    Now I want to rewrite another script with similar scope problems, I think.
    I want to make this working script
    tell application "TorBrowser"
      activate
              if front window exists then
      --on TorGetURLs()
                        delay 0.5
                        tell application "System Events" to tell process "TorBrowser"
      --set theWindows to (reverse of rest of reverse of (get value of attribute "AXChildren"))
                                  set theWindows to value of attribute "AXWindows"
                                  set theURLs to {}
                                  repeat with theWindow in theWindows
                                            tell theWindow
                                                      set value of attribute "AXMain" to true
                                                      set value of attribute "AXMinimized" to false
                                                      repeat
                                                                keystroke "l" using command down
                                                                keystroke "c" using command down
                                                                delay 0.2
                                                                if theURLs does not contain (the clipboard) then
                                                                          set end of theURLs to the clipboard
                                                                          key code 48 using control down
                                                                          delay 0.2
                                                                else
                                                                          exit repeat
                                                                end if
                                                      end repeat
                                            end tell
                                  end repeat
                        end tell
      --end TorGetURLs
      --on TorNewIdentity()
                        set {x, y} to bounds of front window
                        set xOffset to 85
                        tell application "System Events" to tell process "TorBrowser"
                                  set isFullScreen to value of attribute "AXFullScreen" of front window
                                  if isFullScreen then
                                            set yOffset to 40
                                  else
                                            set yOffset to 65
                                  end if
                        end tell
                        tell me to do shell script "cliclick -r c:" & (x + xOffset) & "," & (y + yOffset)
                        delay 0.1
                        tell application "System Events" to keystroke "i"
                        delay 0.4
                        tell me to do shell script "open -b org.mozilla.torbrowser http://www.yourip.us/"
      --end TorNewIdentity
      --on TorRestoreState()
                        repeat with theURL in theURLs
                                  delay 0.1
                                  if theURL as text is not "about:tor" then ¬
                                            tell me to do shell script "open -b org.mozilla.torbrowser " & theURL
                        end repeat
                        delay 0.5
                        tell application "System Events" to tell process "TorBrowser"
                                  if isFullScreen then set value of attribute "AXFullScreen" of front window to true
                        end tell
      --end TorRestoreState
              end if
    end tell
    into this
    tell application "TorBrowser"
      activate
              if front window exists then
                      TorGetURLs()
                      TorNewIdentity()
                      TorRestoreState()
              end if
    end tell
    with the handlers outside the tell block.

  • Difference between value attribute and value attribute under Node in contex

    I have very basic question..it might be very simple but it is giving me a problem.
    I have created one Node name "Input" and value attribute "Input1" under it.
    I have just created one more value attribute named "in1" not under any Node.
    I have created two input filed in the my view.One first I have mapped the value in properties
    to variables "Input.Input1" and on another "in1".
    When I deploy and run the application one Input box is coming as readonly and other is working fine .Will anybody tell me why it is so?

    There is no major difference between value attribute and inside a node.
    It is a separation of attributes. Usually all the attributes belongs to same purpose will create in one value node. Like, calling one BAPI - requestListBAPI - it contains all the bapi related value attributes.
    For your question, one field is read only(Input.Input1), bcz that context is not created. see the context properties.....cardinality will be 0..n. Change the cardinality to 1...n (<b>or</b>) create that context element .
    In your implementation create that value node like this in your init method.
    wdContext.createInputElement();
    It will solve your problem.
    in1 - is a value attribute, which is mapped to your input element. It wont have any problem.
    Regards,
    Sri

  • How can I set a variable number of values in a SQL IN clause?

    Hi,
    How can I set a variable number of values in a SQL IN clause without having to change the text of the SQL statement each time?
    I read the link http://radio.weblogs.com/0118231/2003/06/18.html. as steve wrote.
    SELECT *
    FROM EMP
    WHERE ENAME IN (?)
    But we need the steps not to create type in the system and would there be any other solution if we would like to use variable number of values in a SQL IN clause ?
    We are using JDeveloper 10.1.3.2 with Oracle Database 10.1.3.2
    Thanks
    Raj

    Hi,
    can you please explain why the solution from steve is not the right solution for you.
    regards
    Peter

  • Creation of Variable with single values in BPS

    Dear All,
    I have a very basic requirement in creating variables that would accept single values from the user in BPS.
    Could anyone pls provide me the steps in doing so?
    I am able to create and use varibles with value ranges but could not find the option to create variables with  single values.
    Regards,
    Srini.

    Hi Raj,
    I have already been  thru SAP help file but,  though it says we can create variables with single values, it does not  provide any steps in creating it.
    Any suggestions?
    Regards,
    Srinivas Kamireddy.
    Edited by: Srinivas Kamireddy on Apr 25, 2008 7:59 PM

  • Report script - using substitution variable with multiple values

    Hi All,
    Substitution variable with multiple values is not working correctly with Report scripts. Can you please let me know what is the syntax to assign multiple values to a sub variable using maxl:
    alter database samp.samp set variable 'ExtractQuarter' 'Q1,Q2,Q3,Q4';
    alter database Samp.Samp set variable 'ExtractQuarter' 'Q1:Q4';
    I tried both of the above but they are errored out with the below error:
    Error: 1001005 - Unknown Member [Q1:Q4] in Report.
    my requirement is different for both Actual and forecast data extract so i would like to make use of this variable to extract whole year data for Forecast and current quarter data for Actual with out duplicating the report scripts for both processes.
    Thanks,
    PRaveen

    Hi,
    Please refer following thread,
    range of months in report script?
    Hope it helps.
    Regards

  • How can I get the variable with the value from Thread Run method?

    We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
    How can I get the variable with the value?
    This is sample code:
    public class SampleSynchronisation
         public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run method "+sathr.x);
    // I should get Inside the run method::: But I get only Inside
    class sampleThread extends Thread
         public String x="Inside";
         public void run()
              x+="the run method";
    NB: if i write the variable in to a file I am able to read it from external method. This I dont want to do

    We want to access a variable from the run method of a
    Thread externally in a class or in a method. I presume you mean a member variable of the thread class and not a local variable inside the run() method.
    Even
    though I make the variable as public /public static, I
    could get the value till the end of the run method
    only. After that scope of the variable gets lost
    resulting to null value in the called method/class..
    I find it easier to implement the Runnable interface rather than extending a thread. This allows your class to extend another class (ie if you extend thread you can't extend something else, but if you implement Runnable you have the ability to inherit from something). Here's how I would write it:
    public class SampleSynchronisation
      public static void main(String[] args)
        SampleSynchronisation app = new SampleSynchronisation();
      public SampleSynchronisation()
        MyRunnable runner = new MyRunnable();
        new Thread(runner).start();
        // yield this thread so other thread gets a chance to start
        Thread.yield();
        System.out.println("runner's X = " + runner.getX());
      class MyRunnable implements Runnable
        String X = null;
        // this method called from the controlling thread
        public synchronized String getX()
          return X;
        public void run()
          System.out.println("Inside MyRunnable");
          X = "MyRunnable's data";
      } // end class MyRunnable
    } // end class SampleSynchronisation>
    public class SampleSynchronisation
    public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run
    method "+sathr.x);
    // I should get Inside the run method::: But I get
    only Inside
    class sampleThread extends Thread
    public String x="Inside";
    public void run()
    x+="the run method";
    NB: if i write the variable in to a file I am able to
    read it from external method. This I dont want to do

  • How can I get the variable with the value from Thread's run method

    We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
    How can I get the variable with the value?
    This is sample code:
    public class SampleSynchronisation
         public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run method "+sathr.x);
    /* I should get:
    Inside the run method
    But I get only:
    Inside*/
    class sampleThread extends Thread
         public String x="Inside";
         public void run()
              x+="the run method";
    NB: if i write the variable in to a file I am able to read it from external method. This I dont want to do

    Your main thread continues to run after the sathr thread is completed, consequently the output is done before the sathr thread has modified the string. You need to make the main thread pause, this will allow sathr time to run to the point where it will modify the string and then you can print it out. Another way would be to lock the object using a synchronized block to stop the main thread accessing the string until the sathr has finished with it.

  • I can't seem to decide between the 13" or the 15" MacBook Pro. I had a 14.5 in Dell which crashed on me for the third and last time. It was also my primary home computer. Is the 15" necessary or should I just get the 13"?

    I can't seem to decide between the 13" or the 15" MacBook Pro. I had a 14.5" I'm just used to that size. Dell which crashed on me for the third and last time. It was also my primary home computer. Is the 15" necessary or should I just get the 13"? I probably won't be doing any graphics or anything like that.

    It is really a matter of your personal preference. You have to choose between the extra carrying convenience of the smaller machine and the greater "real estate" of the bigger. I use a 15", and have not found it inconvenient for carrying, even on aircraft, where it has to share backpack space with an SLR camera and assorted lenses.

  • Variable with multiple values.

    Hi All,
    Can anyone help me  to create a  variable with multiple values like it should accept two Buisness Area AU10,PH10 in Query.As well as how to use this variable in fox using VARV, VARI,and VARC.
    Thanx&Rgds,
    Indu

    Hi,
      You can write an exit for variable to retrieve two values.
    Usage of this variable in FOX..
    TOTALCOUNT= VARC(variable).
    COUNT = 1.
    DO .
    IF COUNT < TOTALCOUNT.
    varval = VARI( variable, COUNT ).
    COUNT = COUNT + 1.
    ENDIF.
    Hope this helps.
    Regards,
    Bindu

  • Trying to decide between a Macbook air or Macbook Pro retina

    I'm going to college in September and I'm trying to decide between a fully speced out Air or a Retina pro with upped RAM and CPU. My Dad recently got an air and I have played with it quite a bit and it feels really nice and portable, easy to carry around and use during breaks or to type up notes during a class. I would possibly use Photoshop on it at college (In my graphics design class) but I don't know if I will need to. The Retina display seems really awesome but I don't know whether or not to go for the pro, I would also like to play games on it however not too many (for example the something like skyrim). I also have a main gaming desktop which I would use for high intensity programs at home.

    You should also ask this in the MacBook Pro and MacBook Air forums. This is the forum for the white and black plastic MacBooks that were discontinued in 2010. You should also post this question there to increase your chances of getting an answer.
    https://discussions.apple.com/community/notebooks/macbook_pro
    https://discussions.apple.com/community/notebooks/macbook_air

  • Difference between value and binding ?

    hello
    I am afraid I am not clear on difference between value and binding of a component?
    I will appreciate if you supply an explanation.
    kind regards

    Binding? Aren't you talking about JSF? That term doesn't occur in JSP world.

Maybe you are looking for

  • Exchange 2007,  Contacts and Calendar OK , Email only folder structure

    Hi, as i was reading many different topics I found that many of them had mixed answers between Exchange 2003, Exchange 2003 and 2007. Because of this mess, i wanted to focus ONLY on *EXCHANGE 2007*. That´s been said... I have configured my iPhone wit

  • Can't close windows and palettes created in a script (CC)

    Hi, I developped a Script for After Effects, and sometimes I need to show a window or a palette, but when this window is showed more than once, it can't be closed again (the close button, the one with the cross on the title bar) does nothing, whether

  • XML Data Source: does not seem to validate against XSD

    I setup XML data source using the example "b-c.xml" and "b-c.xsd"; I changed the root element of "b-c.xml" from "<db>" to "<Customers>"; but Liquid Data does not seem to care or validate the instance document against the XSD. Is this a known bug? It'

  • Transfering a file to adobe reader 8

    I am running vista on my computer and have acrobat reader 8.0. I have saved and zipped several files in an XPS format. I have to convert that to an adobe file that I can actually open. I downloaded a cute pdf and a converter from the college that I a

  • Informatica parent child mapping

      down votefavorite I have a scenario where suppose saycountry      province      city      zip ind           ts           hyd       xyz ind          maha          mum       abc Desired output:id   name         parent-id 1    india         1 2    tel