Mostrando entradas con la etiqueta web server. Mostrar todas las entradas
Mostrando entradas con la etiqueta web server. Mostrar todas las entradas

12 de noviembre de 2021

Barleymap MorexV3 2021 release

Barleymap (https://floresta.eead.csic.es/barleymap), a Web tool for mapping the position of genetic markers along the physical and genetic maps of the barley genome, has been updated and now it supports the Morex V3 genome.

Previous maps, including the IBSC Barley Physical Map,the POPSEQ map and the 2017 Morex Genome, are still available linked to their mapped datasets. The current version adds to these the recently released MorexV3 genome, as taken from the INSDC archives (GCA_904849725.1) and Ensembl Plants, with slightly modified chromosome names for convenience:

>chr1H_LR890096.1
>chr2H_LR890097.1
>chr3H_LR890098.1
>chr4H_LR890099.1
>chr5H_LR890100.1
>chr6H_LR890101.1
>chr7H_LR890102.1
 

The unplaced contigs have unchanged names such as:

>CAJHDD010000001.1

The following new datasets are available for MorexV3:

  • PGSB genes: 35,826 HC and 45,849 LC genes (e.g.: HORVU.MOREX.r3.1HG0000030).
  • BaRT 1.0 gene models: 45,619 genes (e.g.: BART1_0-u00002) lifted-over with litfoff
  • NCBI Entrez CDS: 292 sequences clustered with GET_HOMOLOGUES-EST
  • Illumina 50K markers: 43,078 sequences with positions provided by JHI
  • centromeric regions
  • The server now works through a secure HTTPS connection using a Let's Encrypt certificate. The web code and the standalone version are available at https://github.com/Cantalapiedra/barleymap_web and https://github.com/Cantalapiedra/barleymap respectively.


     Table. Sample output of "Align" search with dataset features decorating the region of interest. Note that by default gmap and BLASTN are used as alignment engines, supporting the alignment of genomic sequences and transcripts. Read more at https://link.springer.com/article/10.1007/s11032-015-0253-1


    Please get in touch at compbio@eead.csic.es if you find anything broken,
    Bruno

    25 de septiembre de 2018

    SequenceServer: nice local blast

    Hi,
    today I wanted to let you know about a tool that we discovered recently that has been very useful for us. Its name is SequenceServer (http://www.sequenceserver.com). It is simply a wrapper to let your collaborators run NCBI BLAST searches on your local sequence databases.
    All you need is a copy of the NCBI folder with some BLAST+ release and a Linux distribution. Here we had ncbi-blast-2.7.1+ already in place but had to install the application, which is a ruby application, as recommended by the authors:

    $ sudo gem install sequenceserver

    Due to dependencies during installation I could not manage to install it in Centos5, but instead it was easy in CentOS release 7.5 (sudo yum install ruby-devel). Once this is done, and the appropriate port is open in the host, all that remains is to let the application know where the sequence databases are. You can do that with these commands:

    $ sequenceserver -d /path/to/dbs  # add new databases
    $ sequenceserver -l               # list installed dbs
    $ sequenceserver &                # launch web application 
     

    Now you are ready to go. Your users need to type the URL:port of your host in their browser and they can now run their searches. This is the way it looks in our server:


    Cheers, Bruno

    PS I will be moving to the EMBL-EBI so there might be a break in this blog, but please keep in touch

    27 de diciembre de 2010

    Enviar y recibir datos de un formulario con PHP

    Por mucho que nos guste programar en Perl, a veces hay que recurrir a otros lenguajes más adecuados para propósitos concretos. Este es el caso de PHP cuando se trata de realizar interfaces web para nuestros scripts de Perl.
    El primer problema que nos surge al pasar a PHP es cómo enviar y recibir datos a través de un formulario web. Los datos enviados los podemos usar para ejecutar en el servidor nuestro script de Perl y generar resultados.
    A continuación muestro el ejemplo de un formulario de búsqueda de secuencias DNA o Proteínas:

     <?php  
     // Shows a search input data formulary  
     function showSearchForm(){  
          ?>  
          <h3>Search form:</h3></br>  
          <form enctype="multipart/form-data" action="<?php print $_SERVER['PHP_SELF'] ?>" method="POST">  
          Search name: <input type="text" name="search_name" size="40" maxlength="127"></br></br>  
          Email: <input type="text" name="user_email" size="40" maxlength="127"></br></br>  
          Search input type:  
          <input type="radio" name="search_type" value="stamp"> DNA  
          <input type="radio" name="search_type" value="blastp"> Protein  
          </br></br>  
          Exclude query from results <input type="checkbox" name="search_exclude" value="yes"></br></br>  
          Limit number of results per query: <input type="text" name="search_limit" size="2" maxlength="2"></br></br>  
          Query data or file:</br></br>  
          <textarea name="query_data" rows="10" cols="67"></textarea>  
          </br></br>  
          <input type="file" name="query_file" size="20"></br></br>  
          Genomes:   
          <select name="specie" class="selectbutton">  
          <option value="human">Homo sapiens</option>  
          <option value="mouse">Mus musculus</option>  
          <option value="arabidopsis">Arabidopsis thaliana</option>  
          <option value="rice">Oryza sativa</option>  
          </select>  
          </br></br>  
          <input type="submit" name="search_submitted" value="Search">  
          </form>  
          <?php  
     }  
     ?>  
    

    El siguiente paso consistirá en validar los datos introducidos para volver a mostrar el formulario si los datos fueran erróneos. Usaremos la variable especial $_SESSION para guardar los datos enviados con el formulario (almacenados en la variable $_POST). La variable $_SESSION nos permitirá acceder a su contenido si ejecutamos 'session_start()' al comienzo del código PHP. Antes de guardar los datos enviados, borraremos los contenidos anteriores de $_SESSION. Si en vez de enviar un archivo, hemos enviado datos en formato texto, guardaremos estos datos en un archivo temporal ($_SESSION['query_file']). Si faltan datos en algún campo del formulario, crearemos un mensaje de error en $_SESSION['errors'].

     <?php  
     // Validates search form data  
     function validateSearchData(){  
          // Stores in $_SESSION variable all the post data and in $_SESSION['errors'] if some important data is missing  
          // Clear previous $_SESSION values  
          unset($_SESSION['errors']);  
          unset($_SESSION['search_name']);  
          unset($_SESSION['user_email']);  
          unset($_SESSION['search_type']);  
          unset($_SESSION['search_exclude']);  
          unset($_SESSION['search_limit']);  
          unset($_SESSION['specie']);  
          unset($_SESSION['output_dir']);  
          unset($_SESSION['query_file']);  
          unset($_SESSION['query_data']);  
          (!empty($_POST['search_name'])) ? $_SESSION['search_name'] = trim($_POST['search_name']) : $_SESSION['errors'][] = 'name for the search';  
          (!empty($_POST['user_email'])) ? $_SESSION['user_email'] = trim($_POST['user_email']) : $_SESSION['errors'][] = 'email';;  
          (!empty($_POST['search_type'])) ? $_SESSION['search_type'] = $_POST['search_type'] : $_SESSION['errors'][] = 'search input type';  
          if (!empty($_POST['search_exclude'])){  
               ($_POST['search_exclude'] == 'yes') ? $_SESSION['search_exclude'] = 1 : $_SESSION['search_exclude'] = 0;  
          }  
          (!empty($_POST['search_limit'])) ? $_SESSION['search_limit'] = trim($_POST['search_limit']) : '';  
          (!empty($_POST['specie'])) ? $_SESSION['specie'] = $_POST['specie'] : '';  
          // Store the query data into a file inside the /tmp folder  
          if (!empty($_FILES['query_file']['name']) && !empty($_FILES['query_file']['tmp_name']) && $_FILES['query_file']['size']>0){  
               $_SESSION['query_file'] = $_FILES['query_file']['tmp_name'];  
          }elseif (!empty($_POST['query_data'])){  
               $_SESSION['query_data'] = $_POST['query_data'];  
               $_SESSION['query_file'] = '/tmp/'.$_SESSION['search_name'].".data";  
               $file_handle = fopen($_SESSION['query_file'], "w");  
               fwrite($file_handle, $_POST['query_data']);  
               fclose($file_handle);  
          } else{  
               $_SESSION['errors'][] = 'data or file to process';  
          }  
          if (isset($_SESSION['errors'])){  
               return;  
          }  
     }  
     ?>  
    

    Finalmente, falta introducir las dos funciones anteriores en un archivo (por ejemplo 'index.php') para que sean leídas e interpretadas por el servidor web. Si los datos del formulario son válidos se ejecutará un pequeño código de Perl, si no se volverá a mostrar el formulario indicando los datos que faltan.

     <?php  
     // Example file of a PHP search formulary with input data validation and script execution  
     session_start();  
     ?>  
     <html>  
     <head>  
     <title>Search Form</title>  
     </head>  
     <body>  
     <?php  
     if(!isset($_POST['search_submitted'])){  
          ?><h3>Search form:</h3><?php  
          showSearchForm();  
     } else {  
          validateSearchData();  
          if (!isset($_SESSION['errors'])){  
               executeScript();  
          } else {  
               ?><h3>Search form:</h3><?php  
               print '<font color="red"><b>Please specify: '.join(', ',$_SESSION['errors']).'.</b></font></br></br>';  
               unset($_SESSION['errors']);  
               showSearchForm();  
          }  
     }  
     ?>  
     </body>  
     </html>  
     <?php  
     // Shows an input data formulary filled with previous values  
     function showSearchForm(){  
          ?>  
          <form enctype="multipart/form-data" action="<?php print $_SERVER['PHP_SELF'] ?>" method="POST">  
          Search name: <input type="text" name="search_name" size="40" maxlength="127" <?php ($_SESSION['search_name']) ? print 'value="'.$_SESSION['search_name'].'"' : '' ?> ></br></br>  
          Email: <input type="text" name="user_email" size="40" maxlength="127" <?php ($_SESSION['user_email']) ? print 'value="'.$_SESSION['user_email'].'"' : '' ?> ></br></br>  
          Search input type:  
          <input type="radio" name="search_type" value="stamp" <?php ($_SESSION['search_type'] == 'stamp') ? print 'checked' : '' ?>> DNA  
          <input type="radio" name="search_type" value="blastp" <?php ($_SESSION['search_type'] == 'blastp') ? print 'checked' : '' ?>> Protein  
          </br></br>  
          Exclude query from results <input type="checkbox" name="search_exclude" value="yes" <?php ($_SESSION['search_exclude'] == 'yes') ? print 'checked' : print 'checked' ?>></br></br>  
          Limit number of results per query: <input type="text" name="search_limit" size="2" maxlength="2" <?php ($_SESSION['search_limit']) ? print 'value="'.$_SESSION['search_limit'].'"' : print 'value="10"'; ?> ></br></br>  
          Query data or file:</br></br>  
          <textarea name="query_data" rows="10" cols="67"><?php ($_SESSION['query_data']) ? print $_SESSION['query_data'] : '' ?></textarea>  
          </br></br>  
          <input type="file" name="query_file" size="20"></br></br>  
          Genomes:   
          <select name="specie" class="selectbutton">  
          <option value="human" <?php (!isset($_SESSION['specie']) || $_SESSION['specie'] == 'human') ? print 'selected' : '' ?>>Homo sapiens</option>  
          <option value="mouse" <?php ($_SESSION['specie'] == 'mouse') ? print 'selected' : '' ?>>Mus musculus</option>  
          <option value="arabidopsis" <?php ($_SESSION['specie'] == 'arabidopsis') ? print 'selected' : '' ?>>Arabidopsis thaliana</option>  
          <option value="rice" <?php ($_SESSION['specie'] == 'rice') ? print 'selected' : '' ?>>Oryza sativa</option>  
          </select>  
          </br></br>  
          <input type="submit" name="search_submitted" value="Search">  
          </form>  
          <?php  
     }  
     // Validates search form data  
     function validateSearchData(){  
          // Stores in $_SESSION variable all the post data and in $_SESSION['errors'] if some important data is missing  
          // Clear previous $_SESSION values  
          unset($_SESSION['errors']);  
          unset($_SESSION['search_name']);  
          unset($_SESSION['user_email']);  
          unset($_SESSION['search_type']);  
          unset($_SESSION['search_exclude']);  
          unset($_SESSION['search_limit']);  
          unset($_SESSION['specie']);  
          unset($_SESSION['output_dir']);  
          unset($_SESSION['query_file']);  
          unset($_SESSION['query_data']);  
          (!empty($_POST['search_name'])) ? $_SESSION['search_name'] = trim($_POST['search_name']) : $_SESSION['errors'][] = 'name for the search';  
          (!empty($_POST['user_email'])) ? $_SESSION['user_email'] = trim($_POST['user_email']) : $_SESSION['errors'][] = 'email';;  
          (!empty($_POST['search_type'])) ? $_SESSION['search_type'] = $_POST['search_type'] : $_SESSION['errors'][] = 'search input type';  
          if (!empty($_POST['search_exclude'])){  
               ($_POST['search_exclude'] == 'yes') ? $_SESSION['search_exclude'] = 1 : $_SESSION['search_exclude'] = 0;  
          }  
          (!empty($_POST['search_limit'])) ? $_SESSION['search_limit'] = trim($_POST['search_limit']) : '';  
          (!empty($_POST['specie'])) ? $_SESSION['specie'] = $_POST['specie'] : '';  
          // Store the query data into a file inside the /tmp folder  
          if (!empty($_FILES['query_file']['name']) && !empty($_FILES['query_file']['tmp_name']) && $_FILES['query_file']['size']>0){  
               $_SESSION['query_file'] = $_FILES['query_file']['tmp_name'];  
          }elseif (!empty($_POST['query_data'])){  
               $_SESSION['query_data'] = $_POST['query_data'];  
               $_SESSION['query_file'] = '/tmp/'.$_SESSION['search_name'].".data";  
               $file_handle = fopen($_SESSION['query_file'], "w");  
               fwrite($file_handle, $_POST['query_data']);  
               fclose($file_handle);  
          } else{  
               $_SESSION['errors'][] = 'data or file to process';  
          }  
          if (isset($_SESSION['errors'])){  
               return;  
          }  
     }  
     // Executes a Perl script and prints the output  
     function executeScript(){  
          $output = `perl -e 'print "Hello world\n"'`;  
          print '<pre>'.$output.'</pre>';  
     }  
     ?>