I want to know if i am on the right track

'm still working on my DNA sequencing project (i am further along thank goodness) but now, i want to check my thought process.
Okay, i have to write a new method public void addEdge(int i, int k)
that creates an edge sequence between vertex j and k.
What these need to do is take the watson-crick compliment of the last half of j concatenated with the watson-crick of the first half of k. So it looks kind of like this:
sequence
ATTATAAACCA
watson-crick edge compliment
TGGTTTATAAT
here is my thought process
1. take the initial sequence array and divide it by 2
2. then go through the first half and change the compliments
3. then do the same with the second half and concantenate them together
so it would look like
for(int i = 0; i < seqArray.length/2; i++){
base = rand.nextInt(4);
if(base==0)
tube+="T";
else if(base==1)
tube+="A";
else if(base==2)
tube+="C";
else if(base==3)
tube+="G";
for(int j = seqArray.length/2; j < seqArray.length; j++){
base = rand.nextInt(4);
if(base==0)
tube+="T";
else if(base==1)
tube+="A";
else if(base==2)
tube+="C";
else if(base==3)
tube+="G";
new Sequence(tube)= seqArray[i] + seqArray[j];What do you think? am i on the right track?
}

Something like the following?
public class WC {
    private static char complement(char base) {
        switch (base) {
            case 'A': return 'T';
            case 'T': return 'A';
            case 'G': return 'C';
            case 'C': return 'G';
            default:
                throw new IllegalArgumentException("unrecognised base "+base);
    private static char[] complement(char[] bases) {
        int size = bases.length;
        char[] complement = new char[size];
        for (int i = 0; i < size; i++) {
            complement[i] = complement(bases);
return complement;
public static void main(String[] args) {
String s = args[0];
String s1 = s.substring(0, s.length()/2);
String s2 = s.substring(s.length()/2);
char[] c1 = s1.toCharArray();
char[] c2 = s2.toCharArray();
s1 = new String(complement(c1));
s2 = new String(complement(c2));
System.out.println(s);
System.out.println(s2+s1);
Cheers, Neil

Similar Messages

  • Just want to check whether i am on the right track

    Im trying to learn to do a feedback form for an online application(online store) where the user input whatever he want in a textbox and click submit and then the text will be sent to a specified email.
    Just want to check whether the stuffs i should be reading on are servlets and javamail??
    if there any more things which i should read on and i did not state it above,i would be glad if u guys could enlighten me with the relevant information
    tomleo

    You probably want to save the user's e-mail address and any other identifying information he/she submitted in the questionaire. For this, you will probably want to use a database, so I would suggest learning JDBC as well.
    - Saish

  • Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files but still have them on the TC for future reference..

    Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files on iMac 20inch but still have them on the TC for future reference..eg some movies on iTunes. I want to directly save them on the drive so I can delete them from iTunes and gain some storage. (Ps on iMac 20 inch (it's almost full - 320 GB) when I enter time machine, a tab comes up on finder which reads "Time Machine backups" it's able to be ejected like a disc or a connected device. On the iMac 20 inch, I dragged some files onto there as if using it like a hard drive. Is this the correct method? Then I went to my 27inch iMac and saw the "Time Machine Backups" hoping to see the files I dragged from the 20inch iMac. But the files were not there except a folder that said "Backups.backupdb". Can someone help me?

    It's not a good idea to use a network disk for both Time Machine backups and other things.  By design Time Machine will eventually consume all the space on its output disk, which will then cause problem for your other files.  I'd store those other files on an external disk connected to the Time Capsule.  The problem with that is that Time Machine will only back up files that are local to your Mac.  That means that you'll only have one copy of the files on or attached to your Time Capsule.
    By the way, you've been misled by poor field labeling on this forum into typing a large part of your message into the field intended for the subject.  In the future just type a short summary of your post into that field and type the whole message into the field below that.

  • In My iphone 5s,i have disabled automatic download from whatsapp app.So whichever images,video i feel is good i download them and then save them to my camera roll section.So i want to know how can i remove the images from cache of my phone.

    In My iphone 5s,i have disabled automatic download from whatsapp app.So whichever images,video i feel is good i download them and then save them to my camera roll section.So i want to know how can i remove the images from cache of my phone which are downloaded and not saved,but they remain in cache.
    Even in some apps i have data which i want to remove,but cant find a way to remove them and they are in my cache eating up my memory.

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

  • Hey .... i am from israel and i want to buy a macbook pro in usa ...... i want to know it possible to change the keyboard to hebrew

    hey .... i am from israel and i want to buy a macbook pro in usa ...... i want to know it possible to change the keyboard to hebrew

    Nobody in these forums represents Apple or any store.  So to find out whether you can buy something, you must contact stores or consult their websites directly yourself.   If not available in the online store, try contacting a retail store and see if they can make a special order
    http://www.apple.com/retail/
    Apple stores do not ship abroad.

  • I have a late 2012 iMac and a late 2009 mac mini.  I want to know if I can take the 8 GB of ram from the iMac and install it in my mac mini.

    I have a late 2012 iMac and a late 2009 mac mini.  I want to know if I can take the 8 GB of ram from the iMac and install it in my mac mini.
    According to Cruicial my mac mini could use:
    Module Size: 8GB Kit (4GBx2)
    Package: 204-pin SODIMM
    Feature: DDR3 PC3-8500
    Specs: DDR3 PC3-8500 • CL=7 • Unbuffered • NON-ECC • DDR3-1066 • 1.35V • 512Meg x 64
    Also According to Cruical my iMac uses:
    Module Size: 8GB Kit (4GBx2)
    Package: 204-pin SODIMM
    Feature: DDR3 PC3-12800
    Specs: DDR3 PC3-12800 • CL=11 • Unbuffered • NON-ECC • DDR3-1600 • 1.35V
    I want to increase the ram in both computers. 
    So,  can I put the iMac ram in my mac mini and then I'd only have to buy ram for my iMac?  Naturally the ulitmate test will be when I actually install it,  but having an expectation of success or failure will allow me to plan on what to spend money on.
    Thanks,
    Bear

    Thanks for the responses.  I probably wont even try as my priority is Ram for the mac mini.  2 is not enough.  8 for my imac is okay for now. 
    Somewhere I thought I'd heard that faster Ram would simply clock at the lower speed.  It seems that I am incorrect.
    Thanks,
    Bear

  • I just want to know that how to change the font color, font size, and forgr

    i just want to know that how to change the font color, font size, and forground color in JTextPane for the Selected text. i try diffrerent menthod like setFont and setColor, these methods change the fonts of the whole textpane. so please reply me as soon as possible, and thanks in advance.
    Moazzam

    Sell the Old one... Buy a New one...

  • I want to design some products for resale and I want to know if I can use the included Fonts

    I want to design some products for resale and I want to know if I can use the included Photoshop Fonts and Images or do I have to pay additional licensing fees?  Very new to this and just looking for some basic information or a link to specifics.  Most of what I'm searching for brings up content for publishing and I'm really looking for information about reselling items in a product line.  For example Greeting Cards, Signs etc...  Thanks so much!

    As for fonts, you don't need to do anything as long as you don't try to sell the actual font files. In print or the screen your fine to do as you want. Most fonts include a license EULA for you to read when installing them anyway.
    As for images, that may be a different story, it will depend on the image. If there is a file that accompanies the image that states you can do as you please, that fine, but other wise, assume the image is copyrighted and require permission to use.
    Some programs provide clipart that is for public use this clicpart can be printed and sold. But as with the fonts, you can not sell the clipart files themselves.
    In the EULA that accompanies the software, it should state what can be done with any clipart or fonts that are included with the software.
    If you are still in doubt, contact the company and verify it.

  • I WANT TO KNOW IF I CAN CHANGE THE 3G IPHONE HAVE THE FIRST OF WHICH TOOK 32 GRACIASD

    I WANT TO KNOW IF I CAN CHANGE THE 3G IPHONE HAVE THE FIRST OF WHICH TOOK 32 g thanks

    I don't understand the question.

  • Can you slow down a voicemail you are listening to? I can't understand what someone said to me because they spoke too fast. I just want to know how to slow down the voicemail so I can understand her if it's possible.

    How can you slow down a voicemail you are listening to? Someone sent me a voicemail and they spoke way too fast for me to understand them. I want to know how to slow down the voicemail so I can understand them if that is possible.

       I have to say, this is so weird because it's actually become this way in the past week maybe, and I'm sure me saying this here will be disputed, ridiculed and belittled, and that's absolutely fair, but I've got to say it... up until a few days ago, my iTunes sync/backup area really would keep more than one backup for my one, single iPhone. They were all timed and dated with a drop-down menu (which appeared if I clicked the restore button) to choose which one I wanted to roll back to, for example. Sure, I'd read about the three backups thing etc. etc. and perhaps I got that wrong or misunderstood, but I can honestly say, I only ever had at the most two backups, that I could drop-down and choose to restore from. They were there. Same iPhone. Different dates.
       At the time, when this seemed to be the case, the backing-up process took quite a while. I would leave it to progress while I went and made a cup of tea, come back and it still wasn't finished running. So, not really AGES, but a little while.
       Now, when I perform a backup, the progress bar almost shoots across to a finish. I'll 'fess up... that worries me most of all. I can live without the luxury of a menu of backups... but if it does it once, I'd like to be sure it does it at all.
    Much more importantly though, thank you for your replies so far.
    Any further input, even if it's to belittle or shame is totally welcome. I'd like to understand this a bit more.
    Thanks again.

  • I wanted to know how do you calculate the number of days between two dates

    i wanted to know how do you calculate the number of days between two dates in java ? i get both the dates from the database. i guess there are many issues like leap year and Febuary having diff no of months ..etc.

    thanks..
    I solve my problem as
    public class MyExample {
        public static void main(String a[]) {
            String stdate = "2009-03-01";
            java.sql.Date currentDate = new java.sql.Date(System.currentTimeMillis());
            java.sql.Date preDate = java.sql.Date.valueOf(stdate);
            System.out.println(currentDate);
            System.out.println(preDate);
    //        int dateCom = preDate.compareTo(currentDate);
    //        System.out.println(dateCom);
            long diff = currentDate.getTime() - preDate.getTime();
            int days = (int) Math.floor(diff / (24 * 60 * 60 * 1000));
             System.out.println(days);
    }

  • I want to know what should do if the SPID : 12 Checkpoint is taking time.

    Hi Team,
    I want to know what should do if the SPID : 12 Checkpoint is taking time.
    I can't kill it also.
    Thanks

    It was taking quite long therefore I have pasted here the comments and there was a activity for database restore was pending on that database due to which I have to restart the instance service.
    If next time it will occur what should I do?
    Nothing you cannot do anything reason being it is system process. I guess i said same thing in my comment before. Its just there because system is running checkpoint. I upfront cannot suggest what you should do but I have seen this on many prod databases and
    it is normal. Dont restart SQL Server services if database is in middle of restore
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • HT1918 I changed the card and i want to know how make to change the data from itunes. I tried and doesn't work.

    I changed the card and i want to know how make to change the data from itunes. I tried and doesn't work. Please, Help Me!

    No. That's not what I said. You can get an out of warranty replacement, which will be exactly the same model, color, and will be locked in exactly the same way the original is. If you want an iPhone 5, get the 4S replaced, sell it, and use the money to put toward a new phone.

  • HT1338 Dear all, I have just bought a MacBook pro with osx lion on 25thast month. I wanted to know if I can use the methods described above to update to osx mountain lion or I have to buy osx mountain lion from the app store?

    Dear all, I have just bought a MacBook pro with osx lion on 25th last month. I wanted to know if I can use the methods described above to update to osx mountain lion or I have to buy osx mountain lion from the app store?

    Here are the rules to qualify for the free upgrade:
    http://www.apple.com/osx/uptodate/
    (has to be purchased from Apple or authorized reseller).

  • I have a new MacBook Pro with Lion installed and I want to know if I can partition the HD so that I can install & run Snow Leopard OS 10.6.8?

    I have a new MacBook Pro with Lion installed and I want to know if I can partition the HD so that I can install & run Snow Leopard OS 10.6.8?

    Most likely won't run SL unless it's one that was released before Lion went public. Color SL gone from new Macs.
    27" i7 iMac 10.6.8 , Mac OS X (10.7.2), G4 450 MP 1.5 GB RAM w/(10.5.8/10.4.11/9.2.2)

Maybe you are looking for

  • Indesign crashes when placing pdf created in Xinet Fullpress.

    Indesign crashes when placing a pdf from Xinet Fullpress. Xinet thinks the problem is in inDesign. What to do? The pdf files works fine in acrobat and apple preview.

  • CREATE DOCUMENTO IN WORD - OLE

    Hi to all I have the following issue: I have this code (this is a piece of code), and I need create the document in word (I need that word open it inside of SAP dynpro ) but I need create it with information. With this code, the document is created e

  • Problem While Defining  "VALUE SET"

    Dear All, I am finding problems while defining "Value Set". I wanted to select "DISTINCT" Column from a particular Table. It is not allowing me to select distinct Column. Is there any other alternative ??

  • Party Shuffle - How to exclude songs

    Hi, I have 3 playlists and the library. One playlist contains meditation songs that I do not want to include when using the Party Shuffle at the Library Level. I also want to achieve the same on my iPod Nano. I know I can deselect the songs but it is

  • Examples of popular mobile apps written in FlashBuilder

    A few years ago I learned ActionScript and FlashBuilder. I liked ActionScript's inheritance model and enjoyed working with the language more than with javascript, but I got onto another project and had to set FlashBuilder aside. Now I'm trying to dec