Jump to content

ivytony

Members
  • Posts

    152
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ivytony's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. I have tried to write the following messy code, and it works. But I am looking for improvements, if you guys can help me. <?php $seq = "MAHTSQHILTQSQTPSQPILVSQMASQWRESQ"; echo "Original sequence is: $seq\n"; // $stq_sites = count_stq($seq); //count the number of [s/T]Q sites $sq_sites = substr_count($seq, 'SQ'); $distri_sq = array(); // array container for all the distributions of SQ sites for($i = 0; $i < $sq_sites; $i++){ $needle = "SQ"; $length_needle = strlen($needle); $length_stack = strlen($seq); $pos = strpos($seq, $needle); // $pos += 1; if($pos){ $pos += $length_needle; //the position where the new stack will start $length_stack -= $pos; $seq = substr($seq, $pos, -1); echo "<br />new sequence is: $seq\t with position $pos\n "; if($i > 0) array_push($distri_sq, $pos); } } echo "<br />Size of array: ". sizeof($distri_sq) ."<br />"; echo "avaraged distance is: ". array_sum($distri_sq)/sizeof($distri_sq); ?>
  2. I want to search all the positions of the character combo 'SQ' and 'TQ' in this amino acid sequence: . After finding all the positions, I would also like to compute the distance between each occurrences. I appreciate your help.
  3. thanks, I think str_replace works! I also need to search for "SP" and "TP" sites in the protein sequence, how to do the search more efficiently? I want to equalize "S" with "T" in the search.
  4. but I also want to count the occurrences in the sequence string.
  5. I have a sequence that contains many amino acids (e.g. MATQSTDPEGTGSTTS.....), and I want to find both 'ST' and 'TS' in the sequence. I also want to print out the sequence with 'ST' and 'TS' highlighted in color and report the total number of the 'ST' and 'TS' sites found. pls help me a bit to start coding. thanks!
  6. I'd like to find related entries in MySQL database by looking for similar terms as the current article title. For example, the current article title is 'Giant Scale RC Hawker Sea Fury (HD)' and after using explode for the title, the key words will become 'Giant', 'Scale', 'RC', 'Hawker', 'Sea', 'Fury', and 'HD'. I want to find related entries in database that have one or more of the key words. I wonder how to do it effective? Thanks
  7. I am trying to create a database of Bible that allows people to query by chapter and/or verses. I have the entire bible in a txt file, formatted in this way: I would like to import the file to mysql and save the chapter #, verse # and the verse in three different columns. I wonder how I could possibly do this? Thanks
  8. I also use Apache 2.2.11 with PHP 5.2.8. weird
  9. exactly! PHP Version 5.2.8 Should I install the latest version of Zend Engine?
  10. phpinfo() shows: 1. Loaded Configuration File C:\php\php.ini 2. Loaded Modules: Here's the error message in apache error logs: I wonder what this means?
  11. tried everything, but still xdebug doesn't show up in phpinfo(). I am pretty sure that I am editing the right php.ini file.
  12. all right, I just did what you suggested here, but I still cannot see the 'xdebug' shown in my phpinfo.php output. any ideas? thanks
  13. I am using Apache + PHP 5.2.8 on my laptop installed with Windows Vista 32 and it works just fine. I have been trying to install XDebug since last night, but haven't got any luck getting it to work. Basically, I downloaded the .dll binary file (5.3 VC9) from http://www.xdebug.org/download.php, and put it in the PHP extension directory (C:\php\ext), then changed the php.ini to below: uncommented this line: added this block at the end of the file: I restarted my apache, but I still couldn't find the XDebug section in my phpinfo.php output. I wonder what else I need to do? Thanks in advance!
  14. I have a title like this 'Aero GP Al Ain - Live webcast of Air race and Air Show, a video from AirSportsTV. aero gp al ain, aero gp, live webcast, webcast, live' I want to delete the part shown in bold and keep the first half. However, the first half may be different in other titles, and the second half that I want to delete always starts with ', a video from' I wonder how to do this using wild card.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.