I am new to bioinformatics and have recently started using local version of BLAST. I'm trying to get consistent results with my reference, which is rpl26 gene from Alexandrium tamarense. Depending whether I use local or online versions of blastn, I get different results.
As expected, I get 500 hits from that. However, when i try:
/home/jedrzej/ncbi-blast-2.10.0+/bin/blastn -task blastn -query $query_path -db $db_path -out $out_name -outfmt "6 qseqid sseqid pident length mismatch qstart qend sstart send evalue bitscore sscinames scomnames sblastnames sskingdoms stitle"
I get 511 hits. I suspected the parameters differ from the online version, so I've also tried:
/home/jedrzej/ncbi-blast-2.10.0+/bin/blastn -task blastn -query $query_path -db $db_path -out $out_name -outfmt "6 qseqid sseqid pident length mismatch qstart qend sstart send evalue bitscore sscinames scomnames sblastnames sskingdoms stitle" -word_size 11 -gapopen 5 -gapextend 2 -penalty -3 -reward 2
But the result was the same. Max_target_seqs in blastn defaults to 500, so I suppose there shouldn't be more than 500 hits.
As a side note, I also tried modifying max_target_seqs to 20000:
/home/jedrzej/ncbi-blast-2.10.0+/bin/blastn -task blastn -query $query_path -db $db_path -out $out_name -outfmt "6 qseqid sseqid pident length mismatch qstart qend sstart send evalue bitscore sscinames scomnames sblastnames sskingdoms stitle" -max_target_seqs 20000
But that as well differs from the results of online BLAST, when I increase max target sequences to 20000. I get 1980 (local) vs 1950 (online) hits.
Why do I get different results? Is that a database problem?
Related
Tring to go through new mib i added to mibs file, i have run this command as a test
snmpwalk -v3 -u $USER-l authPriv -a SHA -A "$PASS" -x AES -X $PASS 10.x.x.x panCommonMib
and i think it made the walk on the entire PAN-COMMON-MIB which is good, but some objects there are understandable like
PAN-COMMON-MIB::panSysSwVersion.0 = STRING: x.1.x
And i can translate and know what this obj do.
And some are like that:
PAN-COMMON-MIB::panCommonObjs.7.4.4.1.6.6 = INTEGER: 0
PAN-COMMON-MIB::panCommonObjs.7.5.1.1.201 = STRING: "Log Collector"
PAN-COMMON-MIB::panCommonObjs.7.5.1.2.0 = ""
PAN-COMMON-MIB::panCommonObjs.7.5.1.2.101 = ""
If i try to translate them it gives the textual translate of : panCommonObjs
snmptranslate -IR -Td -OS PAN-COMMON-MIB::panCommonObjs.7.4.4.1.6.6
PAN-COMMON-MIB::panCommonObjs.7.4.4.1.6.6
panCommonObjs OBJECT-IDENTITY
-- FROM PAN-COMMON-MIB
DESCRIPTION "
Sub-tree for common MIB objects."
::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) panRoot(25461) panMibs(2) panCommonMib(1) panCommonObjs(2) 7 4 4 1 6 6 }
I want to understand what is
INTEGER: 0 is, how can i translate this?
Thanks.
Maybe your MIBs are outdated.
snmptranslate -IR -Td -OS PAN-COMMON-MIB::panCommonObjs.7.4.4.1.6.6
PAN-COMMON-MIB::panDeviceLoggingExtFwdStatsTable1minAvgSendRate.6
panDeviceLoggingExtFwdStatsTable1minAvgSendRate OBJECT-TYPE
-- FROM PAN-COMMON-MIB
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS current
DESCRIPTION "Counter for average send rate over 1 minute interval."
::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) panRoot(25461) panMibs(2) panCommonMib(1) panCommonObjs(2) panDeviceLogging(7) panDeviceLoggingExtFwd(4) panDeviceLoggingExtFwdStatsTable(4) panDeviceLoggingExtFwdStatsEntry(1) panDeviceLoggingExtFwdStatsTable1minAvgSendRate(6) 6 }
I got them from github
I'm trying to run an elasticsearch query with scrolling. Here's what I'm trying to do, but it is not working. I'm following the instructions here: https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-request-scroll.html
$ curl -u $(whoami) -XPOST 'https://myhost.io/elasticsearch/_msearch?scroll=1m' --data-binary #query.json -H "kbn-version:6.7.1" | jq
Enter host password for user '<first.last>':
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 973 0 96 100 877 321 2933 --:--:-- --:--:-- --:--:-- 3254
{
"statusCode": 500,
"error": "Internal Server Error",
"message": "An internal server error occurred"
}
Does anyone know why this doesn't work? If I remove the '?scroll=1m', this query works just fine.
You just need to expand the size of the scroll which is set probably to a smaller size
I'm trying to filter ping stats in windows command line using pipe. What I want is to get the 'time' of each ping.
"ping -n 1 -w 1000 " + ip
prints
Pinging 216.52.241.254 with 32 bytes of data:
Reply from 216.52.241.254: bytes=32 time=82ms TTL=240
Ping statistics for 216.52.241.254:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 82ms, Maximum = 82ms, Average = 82ms
The output I'm looking for from that would just be 82.
and my attempt with findstr "ping -n 1 -w 1000 " + ip + ' | findstr time=[0-9]*' prints:
Reply from 216.52.241.254: bytes=32 time=83ms TTL=240
The output should just be 83 this time.
I've tried using grep ?("time=")[0-9]*ms but on top of that line probably not being right I don't think windows grep includes conditionals
I have been at my internship for a couple days and recently was asked to do some Powershell scripting and was excited to learn some new things!
However, it has been a time consuming task because searching for things is so hard to find what you want.
Anyways, I was tasked with removing all sensitive data from a word file. It has not been too bad except until now. For example from a text file:
User pass created now moving on..
Password 7 ##########
All done
Which I had to remove all the numbers after searching the file for "Password 7" and similar tasks which did not take me too long.
Now, I have things such as that are a fixed length after:
Self-Service certificate ####### ######## #######
######## ######## ######## ########## #########
########## ##### ######## ########## ##########
With strings on multiple lines. I can remove the top line, but cannot figure out the next lines because they are just random numbers and I have nothing to search for. I have tried things like nr \n \r and many combinations. I am stumped.
$configFiles=get-childitem . *.txt -rec
foreach ($file in $configFiles)
{
$readIn = #(Get-Content $file.PSPath)
$readIn -replace "Password 7.*" , "Password 7 <REMOVED>" -replace "Secret 5.*" , "Secret 5 <REMOVED>" -replace "snmp-server community\s\S*" , "snmp-server community <REMOVED>" |
Set-Content $file.PSPath
}
That is my current code and it is working well so far. I have been messing around with the multi-line removal in a separate script. Thanks for the help.
Sounds like you are trying to delete a certificate from a Cisco configuration.
$config = #"
!
crypto ca certificate chain TP-self-signed-12345678
certificate self-signed 01
3082022B 30820194 A0030201 02020101 300D0609 2A864886 F70D0101 04050030
4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D31 37363538
528BD5A8 E7E26C51 10BAB609 5B60228F C8DE0299 7BE85C2D 9769FF05 C295706F
3082022B 30820194 A0030201 02020101 300D0609 2A864886 F70D0101 04050030
4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D31 37363538
528BD5A8 E7E26C51 10BAB609 5B60228F C8DE0299 7BE85C2D 9769FF05 C295706F
3082022B 30820194 A0030201 02020101 300D0609 2A864886 F70D0101 04050030
4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D31 37363538
528BD5A8 E7E26C51 10BAB609 5B60228F C8DE0299 7BE85C2D 9769FF05 C295706F
quit
Username joe password bloggs
!
"#
$regex = [regex] '(?sm)certificate self-signed 01\s+([0-9A-F\s]+?)\s+quit'
$result = $config | Select-String -Pattern $regex
$cert = $result.Matches.Groups[1].Value
$censored = $config -replace $cert, '<REMOVED>'
Write-Output $censored
Output:
!
crypto ca certificate chain TP-self-signed-12345678
certificate self-signed 01
<REMOVED>
quit
Username joe password bloggs
!
The trick is to parse the entire text as a single string block and construct a regular expression that can detect the carriage returns embedded in the text.
By default Get-Content will return an array of strings separated at the carriage return. TO load in the test as a single text blob, use the -Raw parameter:
$readIn = Get-Content $file.PSPath -Raw
Then construct a regular expression that can detect the portion you want to remove, carriage returns and all. In this example here, I am assuming that the sensitive bit is 13 blocks of characters at least 5 character long separated by whitespace or carriage return:
$readIn -replace 'Self-Service certificate (\S{5,}[\s\n]+){13}', "Self-Service certificate <removed>`n" | Set-Content $file.PSPath
Which of the following is the correct format for snmptrap (net-snmp) command?
snmptrap -v 2c -c public host "" NET-SNMP-EXAMPLES-MIB::netSnmpExampleHeartbeatNotification \
netSnmpExampleHeartbeatRate i 123456
or
snmptrap -v 2c -c public host "" NET-SNMP-EXAMPLES-MIB::netSnmpExampleHeartbeatNotification \
netSnmpExampleHeartbeatRate.0 i 123456
i.e., with or without .0 in the variable bindings?
Actually both of these formats work, but which one is right or what is the difference?
It depends if "scalar" or a "table row"-related varbinds are being referred to in the trap.
http://www.net-snmp.org/wiki/index.php/TUT:snmptrap states :
Note that this command also includes an (OID,type,value) triple for
the varbinds listed in the VARIABLES clause (in the same way as with
the snmpset command).
Table row example.
snmptrap -v 2c -c public host:162 .1.3.6.1.6.3.1.1.5.3 .1.3.6.1.6.3.1.1.5.3 \
ifIndex i 2 ifAdminStatus i 1 ifOperStatus i 1
For reference :
snmptranslate -m +ALL -Pu .1.3.6.1.6.3.1.1.5.3
IF-MIB::linkDown
No .0 in the variable bindings since id is taken care of by the ifIndex which pinpoints the row.
Scalar row example.
http://www.net-snmp.org/wiki/index.php/TUT:snmptrap shows example
snmptrap -v 1 -c public host UCD-TRAP-TEST-MIB::demotraps "" 6 17 "" \
SNMPv2-MIB::sysLocation.0 s "Just here"
'SNMPv2-MIB::sysLocation.0' is a scalar.
Unlike IF-MIB::linkDown example above, which was related to a table row id-ed by the ifIndex, here the .0s at the end pinpoints the scalar (like when you SET it)
Netsnmp example from original question
mibs/NET-SNMP-EXAMPLES-MIB.txt states
netSnmpExampleHeartbeatRate OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS accessible-for-notify
STATUS current
DESCRIPTION
"A simple integer object, to act as a payload for the
netSnmpExampleHeartbeatNotification. The value has
no real meaning, but is nominally the interval (in
seconds) between successive heartbeat notifications."
::= { netSnmpExampleNotificationObjects 1 }
i.e. it is not a real, identifiable, accessible scalar so I recommend no .0.