Input file:
>position_10 sample:68711 coords:5453-8666 number:3 type:complete len:344
MSINQYSSDFHYHSLMWQQQQQQQQHQNDVVEEKEALFEKPLTPSDVGKLNRLVIPKQHA
ERYFPLAAAAADAVEKGLLLCFEDEEGKPWRFRYSYWNSSQSYVLTKGWSRYVKEKHLDA
NRTS*
>position_4 sample:68711 coords:553-866 number:4 type:partial len:483
MSGVVRSSPGSSQPPPPPPHHPPSSPVPVTSTPVIPPIRRHLAFASTKPPFHPSDDYHRF
KITPSDVENDESDYWLLSNAEISMTDIWKTDSGIDWDYGIADVSTPPPGMGEIAPTAVDS
TPR*
>position_7 sample:68711 coords:453-86 number:2 type:partial len:214
KAAETLEVQKRRIYDITNVLEGIDLIEKPFKNRILWKGVDACPGDEDADVSVLQLQAEIE
NLALEEQALDNQIRWLFVTEEDIKSLPGFQNQTLIAVKAPHGTTLEVPDPDEAADHPQRR
TDSGIDWDYGIADVSTPPPGMGEIAPTAVDSTPR*
>position_11 sample:68711 coords:53-86 number:1 type:complete len:558
MLGDFIIRLLVLILGYTYPAFECFKTVEKNKVDIEELRFWCQYWILLALISSFERVGDFF
RAPRPLNKSLSALRSLEKQTSRGRKWPPPTPPPTPGRDSAGTFNGDDGVNIPDTIPGSPL
TDARAKLRRSNSRTQPAA*
.
.
Output file:
>position_10 sample:68711 coords:5453-8666 number:3 type:complete len:344
MSINQYSSDFHYHSLMWQQQQQQQQHQNDVVEEKEALFEKPLTPSDVGKLNRLVIPKQHA
ERYFPLAAAAADAVEKGLLLCFEDEEGKPWRFRYSYWNSSQSYVLTKGWSRYVKEKHLDA
NRTS*
>position_11 sample:68711 coords:53-86 number:1 type:complete len:558
MLGDFIIRLLVLILGYTYPAFECFKTVEKNKVDIEELRFWCQYWILLALISSFERVGDFF
RAPRPLNKSLSALRSLEKQTSRGRKWPPPTPPPTPGRDSAGTFNGDDGVNIPDTIPGSPL
TDARAKLRRSNSRTQPAA*
.
.
I would like to extract the content and detail match with below criteria:
- header must got the "complete" word (eg. type:complete )
- lens must above or equal to 300 (eg. len:344 and len:558, etc)
It seems like perl, awk, sed able to archive my desired goal.
Thanks a lot for any advice