Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Configurações
- $filename = "seq.fas";
- ////////////////////////////////////////////////////////////////
- // Não mexa daqui em diante! :)
- ////////////////////////////////////////////////////////////////
- $report = array();
- $outFile = "";
- // Lê arquivo
- $filedata = file_get_contents( $filename );
- // Separa em linhas
- $line = explode("\n", $filedata);
- // Pega numero de linhas
- $numLines = count( $line );
- // Realiza o parsing
- for( $i = 0; $i < $numLines; $i++ )
- {
- $matches = "";
- if ( preg_match( '/\#(.+) : _(.+)_ \(.+\) : MITOCHONDRION/', $line[ $i ], $matches ) )
- {
- $report[ $match[0] ] = preg_replace( "/ /", "_", $match[1] );
- }
- else if ( preg_match( '/>(.+)\((.+)\)/', $line[ $i ], $matches ) )
- {
- $outFile = $match[1].".fasta";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment