This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Parsing RNAhybrid output

Hi, I have used RNAhybride to predict miRna to target desired sequence. Can anyone help me in the way to parse output by column as below.

target: NC_031978.2:30702661-30704116 | miRNA : oni-miR-10613 | mfe: -26.5 kcal/mol | p-value: 0.095468

enter image description here

rna-seq

Please do not add screenshots of plain text - it is counterproductive. Instead, copy-paste the text and use the Code Formatting option to present the text well.

code_formatting

1 answer

It is easy on Perl (or Python):

#!/usr/bin/perl

use strict;
use warnings;

while (<>) {
    chomp;
    if (/^target/ or /^miRNA/ or /^mfe/) { print "$_ | "; }
    elsif (/^p-value/) { print "$_\n"; }
}

use as: perl parseRNAfold < IN > OUT

Log in to answer this question.