genomepy.files.filter_fasta

genomepy.files.filter_fasta(infa: str, outfa: str = None, regex: str = '.*', invert_match: Optional[bool] = False) list

Filter fasta file based on regex.

Parameters
  • infa (str) – Filename of the input fasta file.

  • outfa (str, optional) – Filename of the output fasta file. If None, infa is overwritten.

  • regex (str, optional) – Regular expression used for selecting sequences. Matches everything if left blank.

  • invert_match (bool, optional) – Select all sequence not matching regex if set.

Returns

removed contigs

Return type

list