The "progressive" center-star method is defined as follows: the SP MSA would be produced by aligning each successive string sk to the profile of the existing alignment Mk-1. M0= scentral. M1 is produced by aligning s1 to scentral. i need help to Write code for that

Recommended Answers

All 6 Replies

Shsh111 stop asking for people to do the work for you and show us what you have done so far so we can help you. If you get people to do your homework for you your going to struggle when the time comes to do the work yourself which means you're going to have wasted a lot of your own time.

Also reply to your threads once someone has replyed to your question or at least mark it solved, that way we know you've either solved the problem or need more help.

hey chrisHunter
i dont ask people to do my work-i ask help or instruction that will help me to answer my quistion.
i also thank you for your help :)
im kind of new here(and i also don't know english very well-so sorry if i have mistakes)
and i don't know all the rules here

Your english is good. just show some evidence of having made an attemp at the problem, alot of the time you can find the answer on google. We were all new here once so my apologies for sounding rude earlier, i have replyed to your z-algorithm thread but it's in c#, it should translate across to Java easily. Also could you explain the above issue in a little more depth please, what is the progressive center-star method ? what exactly is it that your are trying to do ?

Shsh111 stop asking for people to do the work for you and show us what you have done so far so we can help you. If you get people to do your homework for you your going to struggle when the time comes to do the work yourself which means you're going to have wasted a lot of your own time.

Nah, let's be fair. I think he's got upper-management potential.

are you laughing at me?? :)

private String [ ] MakeColumns ( int centerSequence ,LinkedList<String> notAlignedWithCenterList) {
        String center = sequences [ centerSequence ] ;
        ArrayList<String> alignedWithCenterList = new ArrayList<String >( ) ;
        while ( ! notAlignedWithCenterList.isEmpty ( ) ) {
            String s = notAlignedWithCenterList.poll ( ) ;
            String[ ] seqs = new String [ 2 ] ;
            seqs [ 0 ] = center ;
            seqs [ 1 ] = s ;
            Object scoringFunction;
            Object gapCost;
            TwoStringAlign aligner= new TwoStringAlign ( seqs , scoringFunction, gapCost ) ;
            aligner. align ( true ) ;
            center = aligner.getAlignment ( ) [ 0 ] ;
            ArrayList<Integer> indices = aligner.getIndices ( ) ;
            for (int index : indices) {
                for ( int j = 0 ; j < alignedWithCenterList.size ( ) ; j++) {
                    if ( index > alignedWithCenterList. get ( j ). length()- 1) {
                        alignedWithCenterList. set ( j , alignedWithCenterList. get ( j ) . concat ( "" ) ) ;
                    }
                    else {
                        alignedWithCenterList. set ( j , alignedWithCenterList. get ( j ) .
                                substring ( 0 , index ).concat ( "" ) . concat (
                                        alignedWithCenterList. get ( j ) . substring (index) ) ) ;
                    }
                }
                for ( int k = 0 ; k < notAlignedWithCenterList . size ( ) ; k++) {
                    if ( index > notAlignedWithCenterList.get ( k ). length () -1) {
                        notAlignedWithCenterList . set ( k , notAlignedWithCenterList. get ( k ) . concat ( "" ) ) ;
                    }
                    else {
                        notAlignedWithCenterList.set ( k , notAlignedWithCenterList.get ( k ) .
                                substring ( 0 , index ) .concat( "" ).concat (
                                        notAlignedWithCenterList. get ( k ) . substring ( index ) ) ) ;
                    }
                }
            }
            alignedWithCenterList . add ( aligner . getAlignment ( ) [ 1 ] ) ;
        }
        alignedWithCenterList. add ( center ) ;
        return alignedWithCenterList. toArray (new String [ 0 ] ) ;
    }

}

here is what i start to do'''but there is a problem and i can't figure what is wrong
please if you can find my mistake i really appreciate it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.