Icon representing a recipe

Recipe: Note Remover - LO

created by LociOiling

Profile


Name
Note Remover - LO
ID
47128
Shared with
Public
Parent
None
Children
None
Created on
October 24, 2013 at 21:42 PM UTC
Updated on
October 24, 2013 at 21:42 PM UTC
Description

Removes all segment notes. Any notes found are printed for reference.

Best for


Code


--[[ * Note Remover * Original Author: LociOiling * Version 1.0 October 24, 2013 * Thanks to brow42! * This recipe deletes any segment notes found. * The notes are printed for posteriority. * Useful if you tire of notes after using Cysteine Tagger. * Also good for cleaning up after scripts that leave * state information in notes after a crash. ]]-- version = '1.0' title = 'Note Remover v'..version nSeg = structure.GetCount() nSeg2 = nSeg while structure.GetSecondaryStructure ( nSeg2 ) == "M" do nSeg2 = nSeg2 - 1 end print ( title ) print ( "number of segments = ", nSeg2 ) nFound = 0 for ii = 1, nSeg2 do segNote = structure.GetNote ( ii ) if segNote ~= nil and string.len ( segNote ) > 0 then print ( "segment ", ii, " -- ", segNote ) structure.SetNote ( ii, "" ) nFound = nFound + 1 end end print ( nFound, "notes removed" )

Comments


LociOiling Lv 1

This recipe simply prints and deletes any segment notes it finds. It's intended as companion to the "Cysteine Tagger" recipe. It may also be useful in cleaning up after scripts that leave state information in segment notes when they crash.