1

Closed

Parsing fails for GenBank file generated by Geneious

description

When I parse a GenBank file generated by Geneious, I get the following error:
System.ArgumentOutOfRangeException was unhandled
  HResult=-2146233086
  Message=Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  Source=mscorlib
  ParamName=index
  StackTrace:
       at System.ThrowHelper.ThrowArgumentOutOfRangeException()
       at System.SZArrayHelper.get_Item[T](Int32 index)
       at Bio.Util.IEnumerableExtensions.Last[T](IList`1 list)
       at Bio.IO.GenBank.GenBankParser.ParseSource(String line, Sequence& sequence, StreamReader stream)
       at Bio.IO.GenBank.GenBankParser.ParseHeaders(Sequence& sequence, Int32 noOfSequence, String line, StreamReader stream)
       at Bio.IO.GenBank.GenBankParser.<Parse>d__0.MoveNext()
       at ConsoleApplication1.Program.Main(String[] args) in c:\git\ConsoleApplication1\ConsoleApplication1\Program.cs:line 18
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 
This is caused by Geneious adding an empty line for the classification of the ORGANISM, e.g.:
...
SOURCE      synthetic DNA construct
  ORGANISM  recombinant plasmid
            .
...
The dot is correctly added to classLevels, but is not ignored correctly when the Genus is set.

I have identified the cause of this error, and have created a fix (and unit-test) locally. How can I contribute with this fix to this great project? The Contribution Guide seems somewhat outdated.
Closed Mar 16, 2015 at 3:09 PM by markjulmar
Fixed.

comments

markjulmar wrote Mar 12, 2015 at 5:51 PM

You should be able to issue a pull request from your version of the repo. We are using Git.

jamesmhogan wrote Mar 13, 2015 at 2:15 PM

Welcome jjby, and nice work. Please issue a pull request as suggested by mark and we will take a look.
cheers
jh

jjby wrote Mar 16, 2015 at 8:27 AM

Thanks.

As you might have discovered, I issued a pull-request (http://bio.codeplex.com/SourceControl/network/forks/jjby/NETBio/contribution/8103). As you see, the fix itself is really simple. I also made a minor change to the .gitignore file, hope it's okay.

/Jakob

markjulmar wrote Mar 16, 2015 at 3:08 PM

This has been merged into master - thanks Jakob!