Cleaning up the IDs in a FASTA file

I have some FASTA files with headers like this:

>gi|83274083|ref|AC_000032.1| Mus musculus strain mixed chromosome 10, alternate assembly Mm_Celera, whole genome shotgun sequence

I wanted to extract just the 2nd field, so here's a Perl 6 script to do that:

No Moose Today, Well not much really

So in honour YAPCE 2018 it's shiftin bobbins day here in the Moose-pen.

Carrying on from where I left off in yesterday's post I decided it was time I cleaned up a little more of my code. Seems I do this

use Moose;
    with qw(Database::Accessor::Roles::Base
      Database::Accessor::Roles::Comparators);
    use MooseX::Aliases;
    use MooseX::Constructor::AllErrors;
or code similar to it a almost a dozen times in the Accessor.pm file. Now there is nothing wrong with this but I think I can clean it up a bit by a just a little re-factoring or shifting things about (hence the link at the top).

Short presentation of The new Perl debugger

The link of the project

You may Download presentation or view short video

The main feature of new debugger is debugging debugger commands. Yes you may debug itself (reentrance is not limited). This mean you may extend debugger easily. That is possible because of state of each debugger "copy" is saved in special array accessible through $DB::state

To enable debugger debugging (dd) you turn on this state then run command, you want to debug, after that. Example how to enable debugging debugger command 'step over' (n):

DB::state( 'dd', 1 );
n

Besides new debugger you get the new method to debug scripts and may forget about debugging by 'print' statements.

Now you just put special comment: #DBG: EXPR #

Updating "Toolkit review: Devel::Local, Devel::SimpleTrace, Reply"

2+ years on since I wrote "Toolkit review: Devel::Local, Devel::SimpleTrace, Reply" and I've got a couple more suggestions. I still use Devel::Local a lot but for something more substantial than quick hackery I use mst's App::Myperl.

I don't use Devel::SimpleTrace much anymore.. I switched to Devel::Confess since watching haarg talk about writing it in a video that I can't find right now. Lastly I still use Reply but I've added Toby Inkster's Pry to my secret weapon list. It makes dropping into a Reply interactive session super easy. (Use pry; pry();)

Enlightened Perl Organisation sponsors Strawberry Perl

I am pleased to announce that Enlightened Perl Organisation (EPO) has kindly extended the support of Strawberry Perl project by sponsoring our build server (VPS) for the next 12 months. I would like to thank Mark Keating for arranging the funding.

For those interested in technical details: the build server is MS Windows 2012 R2 virtual private server, 4 CPU, 16 GB RAM, 120 GB HDD.

If you are also considering supporting Strawberry Perl project you can do it indirectly by becoming EPO member or via donating EPO.

YAMP

Yep. You guessed it. Yet Another Moose Post. Today in the Moose-Pen just a quick bit of code cleanup

I stumbled upon some of my early notes for this project today and it seems I forgot to include a MooseX I was keen on using from the beginning, I guess I forgot about it, so a little back programming today.

The MooseX is called ' MooseX::AlwaysCoerce ' and it does what it says, forces all of your attributes to have

coerce   => 1,
unless you set them to

coerce   => 0,

Join me online for 3 hours of Perl 6 training courtesy O'Reilly

Top Ten Things You Need To Know about Perl 6
[The description says 2 hours, but we agreed to 3 over email, I'll get it straightened out. They also got the title from my upcoming OSCON London talk instead the intro, but we'll straighten it out.]

As the title says, I'm working with O'Reilly to deliver a 3-hour training seminar on the basics of Perl 6 in mid-October. This is going to be more targeted to those learning Perl 6 ab initio, rather than seasoned Perl 5 programmers. I do intend to throw a few notes in for current Perl hackers, especially ideas on how to migrate your existing Perl 5 code to Perl 6 in a reasonably painless fashion.

Perl 5 Porters Mailing List Summary: September 5th-11th

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for the past week. Enjoy!

Reply to David Golden "Comparison of Class::Tiny and Object::Simple"

p5p pumpking David Golden wrote the following topic.

Comparison of Class::Tiny and Object::Simple

I'm pleasure he is interested in Object::Simple even if the entry criticize Object::Simple.


----------------------------------------
Yes, you can create custom constructors, but that defeats the syntactic simplicity of Object::Simple.
----------------------------------------

No, No. Custom constructor is very very easy. Nothing is difficult.


-------------------------------------------
Very soon, you'll have re-invented the semantics of BUILD/DEMOLISH.
-------------------------------------------

No, No. Perl calls constructors and destructors in correct order if we use only single inheritance.

I strongly recommend single inheritance in object-oriented programming.

See Object::Simple(CPAN) for more details. I add FAQ section to reply this question.

Moose Police Get out of My Dreams

Well the Moose-Pen is not dead yet as I still found some Moose to blog about, and I though I was so close.

On thing that really bugs me about Perl is the fact you can have a lovely interface like this

  my $thingy = $object->get_some_thing();
  $object->set_some_thing(“Not my thing”);
and then some smarty-pants RFB comes by and does this

  my $thingy = $object->{some_thing};
  $object->{some_thing} = 'Not my thing';
Anyone who ever comes from a OO background say in Java or even C# usually can be heard screaming into the halls of a Perl shop cursing the very day Larry said “let's create some disruption” and have 'c' with types.

Docker::Engine::API 1.24 starting point giveaway

As part of a demo/POC I hacked together a complete Perl binding for the Docker Engine remote API v1.24 (Docker Engine 1.12).

We are sadly not using Perl where I currently work so after demoing some stuff we will move forward using other tech.

There exist some modules on CPAN already but they are not complete and did not work with the new features in Docker.

Perhaps if someone wants to continue the work they can fork and/or merge with the other modules to create a definitive Perl binding for Docker.

Here is the project

* No support will be given
* Rewrite needed
* Look at the Golang binding for ideas for the next steps, eg. types instead of handling everything as JSON

3 interviews about Perl projects

Recently I've started a new interview series published both as videos and as a Podcast.
The first 3 episodes were with Perl developer: Jason Crome on Dancer 2, Sawyer X on Perl 5 Porters, and Joel Berger on Mojolicious

The 4th episode is Tom Hudson on gron that helps making JSON structure grepable.

Alpine Perl Workshop Videos (Day 1)

I have uploaded videos from the first day of the Alpine Perl Workshop (Innsbruck, 2016): https://www.youtube.com/channel/UCLsVz9vprzs6U6PmcI4tnqA. The second day of videos should be done uploading by the same time tomorrow. Some observations from recording/processing/uploading the videos:

Osti d'épais de marde d'orignal

Today in the Moose-Pen I am going to solve a little problem with Moose.

So cleaning up a lot of Moose poop over the last few days and part of that effort is to ensure some of my proposed features with this post. Now I have re-factored that a little today into this sub

Perl 5 Porters Mailing List Summary: August 29nd - September 4th

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for the past week. Enjoy!

Dancer2 0.203001 improves speed of apps, fixes missing dependency

Dancer2 0.203001 is on its way to a CPAN mirror near you. It is essentially a maintenance release, with only two minor changes:

  • Class::Load was replaced by Module::Runtime. This will result in a slightly faster execution time for your Dancer2 apps. This had been applied previously, but was erroneously undone by another commit. Thanks to veryrusty for noticing and fixing!

  • The minimum version of List::Util needed by Dancer2 was omitted from 0.203000, causing some headaches for users of older versions of List::Util.

The full changelog follows:

Simplest class builder "Object::Simple" 3.17 released!

Simplest class builder "Object::Simple" 3.17 released! I rewrite document in this release. I describe the benefits at first.

Simplest class builder, Mojo::Base porting, fast and less memory

  • Simplest class builder. All you learn is only has function!
  • Mojo::Base porting. Do you like Mojolicious? If so, this is good choices!
  • Fast and less memory. Fast new and accessor method. Memory saving implementation.

Check latest Object::Simple document!

MooseX for No Poop

Well there still lots of life in the a little Moose-Pen today seem I still have plenty of poop to cleanup.

Well in my last post I cleaned up a little moose poop and today I am going to take a major step forward and clean up allot more. So far most if not all the poop I have been generation comes from my efforts of either

  1. Having required attributes
  2. Coercion into classes or
  3. Type errors
Well one would think there will be a large amount code to cover in a single post but thanks to Moose I really only have to add

 use MooseX::Constructor::AllErrors

backseat YAPC::EU

Cluj was my ninth YAPC and it was different for me in many ways. Please read this especially if you never been to a YAPC.

Introducing Terminal::Print

After a long incubation period of intermittent hacking, I am pleased to present Perl hackers worldwide with the option to quickly and easily print to their console screen.

Ok.. why?

From the module's README:

Terminal::Print intends to provide the essential underpinnings of command-line printing, to be the fuel for the fire, so to speak, for libraries which might aim towards 'command- line user interfaces' (CUI), asynchronous monitoring, rogue-like adventures, screensavers, video art, etc.

Let's first point out that this module is a serious attempt at solving a relatively frivolous problem. There are plenty of existing text display engines (hello, ncurses!), game engines, and other Perl modules that already solve many command line display (CLD) issues.

However: ncurses is not re-entrant. Furthermore, its UTF-8 support is (understandably) bolted on. Looking around at other C library options, it came to dawn on me: why was I involving "native" options, anyway?

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.